4 ms·
I’ve met too many people who are surprised by millisecond or microsecond timestamp collisions. My most memorable and least favorite variety of this is when peo
by hinkley 3y ago
I’ve met too many people who are surprised by millisecond or microsecond timestamp collisions.
My most memorable and least favorite variety of this is when people try to assemble a timestamp from two system calls, one for the most significant digits and a second for the least.
If the smallest digits roll over from 99x to 00x after you read the large digits, due to process preemption, you can create a time stamp for an entity that happens before the entity that caused it to exist. This breaks some code spectacularly (I’ve seen infinite loops at least twice).
If you haven’t memorized this as a thing to always avoid, you end up with tests that pass 99.5% of the time, and it can take someone with very good pattern matching skills to catch that the same test has been red once a week for a month and a half, which is a very long time for a logic bomb to live in CI/CD code before getting fixed.
- dan-robertson 3y agoMy most memorable example was some support discussion that went something like “we think you have a race condition, <description>” “It can’t be a race condition as those two events happened in the exact same time”