Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Which problem is this PR solving? This is re: #45 (comment) The original code has a rare race condition: 1) On line 180, the `currentIndex` is loaded 2) Context switch to where `currentIndex` is incremented 3) `IncrementKey` is called on the updated index 4) `AggregateCounts` is called on an old `currentIndex`. This is undefined behavior, as `currentIndex` is assumed to be monotonically increasing. To validate that this race condition was fixed, I wrote a script that ran the test 100 times. With the previous code, I observed 7 failures out of 100 runs. With the new code, I observed 0 failures out of 100 runs. ## Short description of the changes Small change to unit tests. Co-authored-by: Yi Zhao <yizhao@stripe.com>
- Loading branch information