-
Notifications
You must be signed in to change notification settings - Fork 9
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
Plugin provider atp race condition #172
Conversation
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.
Although three separate lock regions in the same function sure looks odd, without reading all the called code (which I'm not inclined to do now), I can't say it's excessive or unnecessary.
In any case, yeah, if creating the ATP client is a potential race, you've clearly serialized it within one of the lock regions... 😆
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.
What you have is probably OK, but it would probably be better to avoid doing external stuff with the lock locked.
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.
🚢
Changes introduced with this PR
This moves a line up into a slot in the code at which the mutex is locked. That's it.
That appears to fix the race condition.
By contributing to this repository, I agree to the contribution guidelines.