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(core): Fix deadlock in runMutation and error handling #9085

Merged
merged 7 commits into from
May 19, 2024

Conversation

harshil-goel
Copy link
Contributor

@harshil-goel harshil-goel commented May 14, 2024

We call txn.Update() once the transaction has finished. This moves all the uncommited posting lists to a delta map in the txn. This can cause a deadlock with runMutation. Mostly we have seen it when a transaction has a timeout. RunMutation keeps on going, while txn.Update() gets triggered. This PR fixes it by not calling txn.Update() if the transaction has failed. We would futher look into cancelling runMutation at that time too.

Fixes: https://linear.app/hypermode/issue/DGR-477/dgraph-v24-alpha-2-hangs

@harshil-goel harshil-goel requested a review from a team as a code owner May 14, 2024 06:21
@dgraph-bot dgraph-bot added area/core internal mechanisms go Pull requests that update Go code labels May 14, 2024
@harshil-goel harshil-goel changed the title Fix deadlock in runMutation and error handling Fix(core): Fix deadlock in runMutation and error handling May 15, 2024
@mangalaman93 mangalaman93 merged commit d3d9c5b into main May 19, 2024
12 checks passed
@mangalaman93 mangalaman93 deleted the harshil-goel/deadlock-bug-fix branch May 19, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core internal mechanisms go Pull requests that update Go code
Development

Successfully merging this pull request may close these issues.

None yet

4 participants