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

nsqd: race when persisting metadata #259

Merged
merged 1 commit into from
Aug 21, 2013

Conversation

mreiferson
Copy link
Member

since Notify() can be called from many goroutines this needs to Lock not RLock cc @jehiah

@jehiah
Copy link
Member

jehiah commented Aug 21, 2013

i think this change is good; but it makes me think that another side of this is that we shouldn't use a constant name for the "%s.tmp" file. That would allow our generation to work, and the atomic rename to always succeed regardless of how many time this happens or doesn't happen in parallel.

@mreiferson
Copy link
Member Author

discussed offline... because syscalls are scheduler yield points, we cannot rely on just the atomic rename to provide global ordering of concurrent metadata writes (aka, we need this lock)

jehiah added a commit that referenced this pull request Aug 21, 2013
nsqd: race when persisting metadata
@jehiah jehiah merged commit bff79fc into nsqio:master Aug 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants