-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Access groupi.gid atomically #3402
Conversation
We were accessing groupi.gid without synchronization. This commit ensures that groupi.gid is always accessed atomically.
1739ddb
to
4ed87b5
Compare
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.
Reviewed 4 of 4 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @animesh2049, @mangalaman93, and @manishrjain)
dgraph/cmd/alpha/run.go, line 559 at r1 (raw file):
// TODO (animesh): Not sure why this was done in the first place // _ = numShutDownSig
This looks like it's assigning the value of numShutDownSig to an anonymous variable. It shouldn't have any effect. I think it's safe to remove in this PR.
worker/groups.go, line 293 at r1 (raw file):
func (g *groupi) ServesGroup(gid uint32) bool { // No need to acquire the lock on g because gid is always // accessed atomically via groupId() function
Not sure if this comment is really needed. I suppose it would be useful to someone who remembered the previous version. I'll let you decide if you want to keep it.
In case you want to keep it two comments:
- Period at the end.
- Also, if you can fit the whole comment in a single line (100 columns) it'd be better.
b4fb077
to
0ea0df3
Compare
worker/groups.go, line 293 at r1 (raw file): Previously, martinmr (Martin Martinez Rivera) wrote…
I have removed the comment. |
0ea0df3
to
3bc321a
Compare
3bc321a
to
d2bf3e2
Compare
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.
Reviewable status: 2 of 4 files reviewed, 2 unresolved discussions (waiting on @manishrjain and @martinmr)
dgraph/cmd/alpha/run.go, line 559 at r1 (raw file):
Previously, martinmr (Martin Martinez Rivera) wrote…
// TODO (animesh): Not sure why this was done in the first place // _ = numShutDownSig
This looks like it's assigning the value of numShutDownSig to an anonymous variable. It shouldn't have any effect. I think it's safe to remove in this PR.
Done
worker/groups.go, line 293 at r1 (raw file):
Previously, animesh2049 (Animesh Chandra Pathak) wrote…
I have removed the comment.
Done
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.
Reviewed 2 of 4 files at r1, 2 of 2 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @manishrjain and @martinmr)
@animesh2049 FYI, this PR needed more approvals before merging. Something to keep in mind for next time. |
Martin had approved it, so we went through with it. Will be careful in future. |
sure @manishrjain |
We were accessing groupi.gid without synchronization. This commit ensures that groupi.gid is always accessed atomically. Fixes #3343
This change is