-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fix race condition in SolutionChecksumUpdater work queue #46346
Conversation
dc30732
to
ca372f4
Compare
src/VisualStudio/Core/Def/Implementation/Remote/SolutionChecksumUpdater.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio/Core/Def/Implementation/Remote/SolutionChecksumUpdater.cs
Show resolved
Hide resolved
{ | ||
Contract.ThrowIfFalse(_currentToken is null); | ||
_currentToken = currentToken; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbh, i've stared at thsi a bunch, and i have no feeling on what's happening here or why the new code is more correct. Can you write a non-brief explanation of what this class is trying to accomplish, how tehse two fields play into it, and why the new approach is 'correct'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this class well enough to detail its intended functionality. An explanation of the race condition is here:
The sequencing is complex enough that it required a handwritten derivation before I was able to construct a deterministic failure using 4 counters and 6 instances of ManualResetEventSlim.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ca372f4
to
bb69323
Compare
Fixes #46255