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

fix(ludicrous): Fix data race in executor #7203

Merged
merged 2 commits into from
Dec 24, 2020
Merged

Conversation

ahsanbarkati
Copy link
Contributor

@ahsanbarkati ahsanbarkati commented Dec 24, 2020

The operations on inDeg field of mutation struct should be done atomically because it is being used to check if a mutation in dependent on any other mutation. And the mutations are run concurrently, so this update in inDeg should be protected. This change fixes the data race which results in alpha crash due to calling Done on watermark which is lesser than doneUntil

Potential fix for: DGRAPH-2805


This change is Reviewable

Copy link
Contributor

@jarifibrahim jarifibrahim left a comment

Choose a reason for hiding this comment

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

Does this fix the crash we saw @ahsanbarkati ?

Comment on lines 188 to 189
atomic.AddInt64(&dependent.inDeg, -1)
if atomic.LoadInt64(&dependent.inDeg) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
atomic.AddInt64(&dependent.inDeg, -1)
if atomic.LoadInt64(&dependent.inDeg) == 0 {
if atomic.AddInt64(&dependent.inDeg, -1) == 0 {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It has been running fine since last night. I think this will fix the crash. I'll let it run for a day or two.

@NamanJain8
Copy link
Contributor

Can you please add a brief description in PR description about why this should be atomic?

@ahsanbarkati ahsanbarkati merged commit 49fd1f4 into master Dec 24, 2020
@ahsanbarkati ahsanbarkati deleted the ahsan/mutation-race branch December 24, 2020 09:48
danielmai pushed a commit that referenced this pull request Dec 30, 2020
The operations on inDeg field of mutation struct should be done atomically because 
it is being used to check if a mutation in dependent on any other mutation. And the 
mutations are run concurrently, so this update/read on inDeg should be protected.
ahsanbarkati added a commit that referenced this pull request Jan 15, 2021
The operations on inDeg field of mutation struct should be done atomically because
it is being used to check if a mutation in dependent on any other mutation. And the
mutations are run concurrently, so this update/read on inDeg should be protected.

(cherry picked from commit 49fd1f4)
ahsanbarkati added a commit that referenced this pull request Jan 15, 2021
The operations on inDeg field of mutation struct should be done atomically because
it is being used to check if a mutation in dependent on any other mutation. And the
mutations are run concurrently, so this update/read on inDeg should be protected.

(cherry picked from commit 49fd1f4)
ahsanbarkati added a commit that referenced this pull request Jan 15, 2021
The operations on inDeg field of mutation struct should be done atomically because
it is being used to check if a mutation in dependent on any other mutation. And the
mutations are run concurrently, so this update/read on inDeg should be protected.

(cherry picked from commit 49fd1f4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants