46 karma · joined Aug 15, 2010 (16y ago) · 6 submissions
comment 3y ago · link · parent
Here’s what jumped out at me: “The new account was created in our database with a null value in the URI field.”
Almost every time I see a database-related postmortem — and I have seen a lot of them — NULL is lurking somewhere in the vicinity of the crime scene. Even if NULL sometimes turns out not to be the killer, it should always be brought in for questioning.
My advice is: never rely on NULL as a sentinel value, and if possible, don’t allow it into the database at all. Whatever benefits you think you might gain, they will inevitably be offset by a hard-to-find bug, quite possibly years later, where some innocuous-seeming statement expects either NULL or NOT NULL and the results are unexpected (often due to drift in the semantics of the data model).
Although this was a race condition, if the local accounts and the remote accounts were affirmatively distinguished by type, the order of operations may not have mattered (and the account merge code could have been narrowly scoped).
comment 3y ago · link · parent
comment 5y ago · link · parent
https://craphound.com/down/Cory_Doctorow_-_Down_and_Out_in_t...
comment 5y ago · link · parent
https://craphound.com/down/Cory_Doctorow_-_Down_and_Out_in_t...
comment 6y ago · link · parent
(Especially once you replace the question "do I have enough money to walk out the door with this item?" with "is my government-calculated social reputation score high enough to walk out the door with this item?")
comment 12y ago · link · parent