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

Plugin provider atp race condition #172

Merged
merged 36 commits into from
Apr 17, 2024

Conversation

jaredoconnell
Copy link
Contributor

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.

Copy link

@dbutenhof dbutenhof left a 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... 😆

Copy link
Contributor

@webbnh webbnh left a 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.

internal/step/plugin/provider.go Outdated Show resolved Hide resolved
Copy link
Contributor

@webbnh webbnh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@jaredoconnell jaredoconnell merged commit 5c54a86 into main Apr 17, 2024
5 checks passed
@jaredoconnell jaredoconnell deleted the plugin-provider-atp-race-condition branch April 17, 2024 21:49
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 this pull request may close these issues.

4 participants