Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enqueue Counter Race Condition #42

Closed
bashbaug opened this issue Sep 25, 2018 · 0 comments · Fixed by #192
Closed

Enqueue Counter Race Condition #42

bashbaug opened this issue Sep 25, 2018 · 0 comments · Fixed by #192

Comments

@bashbaug
Copy link
Contributor

Observed Behavior

With a multi-threaded application there is a chance that two "enqueue" API calls may be logged with the same "enqueue counter". This is because the main enqueue counter is used throughout the API call and only updated at the end of the API call, so if two threads happen to execute an API call at approximately the same time, they may both execute using the same main enqueue counter.

Desired Behavior

Ensure that each API call is logged with a unique enqueue counter. One way to accomplish this is to safely assign and increment the main enqueue counter at the start of the API, and then to only refer to the assigned enqueue counter while the API call is executing.

Steps to Reproduce

Because this issue requires timing and multiple threads reproducibility is not 100%, but it should be possible to see multiple API calls with the same enqueue counter with a sufficiently long running multi-threaded application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant