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

Protect NewFilenameUnadjuster from concurrent map writes #1192

Merged

Conversation

Helcaraxan
Copy link
Contributor

@Helcaraxan Helcaraxan commented Jun 21, 2020

As signalled in #612 there has been another occurrence of concurrent map writes.

This should address the issue by passing a mutex alongside the map and locking it when writing. Given that the concurrent writes are only occurring while the map is being filled we do not need to pass the mutex back as part of the FilenameUnadjuster struct. Consumers of this type should protect against concurrency issues themselves when operating on the enclosed map field.

Copy link
Member

@jirfag jirfag left a comment

Choose a reason for hiding this comment

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

thank you!

@Helcaraxan
Copy link
Contributor Author

@jirfag do you need anything from me in order to merge this? Happy to do so if required, just want to make we're not blocked by anything that I can help with. 🙂

@michaljemala
Copy link

@Helcaraxan Could we pls get this merged soon-ish? :-)

@Helcaraxan
Copy link
Contributor Author

@michaljemala I do not have write access on the repository so I can't merge it unfortunately, hence my previous question to @jirfag. 😞

@bombsimon
Copy link
Member

I'll merge this, although I don't know when we will get a new release.

@bombsimon bombsimon merged commit 5f0de29 into golangci:master Jun 25, 2020
@golangci-automator
Copy link

Hey, @Helcaraxan — we just merged your PR to golangci-lint! 🔥🚀

golangci-lint is built by awesome people like you. Let us say “thanks”: we just invited you to join the GolangCI organization on GitHub.
This will add you to our team of maintainers. Accept the invite by visiting this link.

By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.
More information about contributing is here.

Thanks again!

@Helcaraxan
Copy link
Contributor Author

Ah great. Many thanks @bombsimon ! Now I can contribute better. My previous contribution pre-dates the existence of the automator. 🙂

@Helcaraxan Helcaraxan deleted the bugfix/612-concurrent-map-writes branch June 25, 2020 13:00
@ldez ldez added this to the v1.28 milestone Mar 6, 2024
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.

None yet

5 participants