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 a deadlock condition #331

Merged
merged 2 commits into from
Sep 16, 2020
Merged

Conversation

sillycross
Copy link
Contributor

In OpenSegment(), we are holding a lock to do a bunch of operations, which includes bumping an epoch. Bumping an epoch could trigger drain callbacks, which includes the flush callback. The flush callback may in turn call OpenSegment() again, which would take the lock again, resulting in a self-deadlock.
The solution is to release the lock before bumping epoch: the lock is only to protect the file list, which is already releasable at this point.

sillycross and others added 2 commits September 15, 2020 16:31
In OpenSegment(), we are holding a lock to do a bunch of operations, which includes bumping an epoch. Bumping an epoch could trigger drain callbacks, which includes the flush callback. The flush callback may in turn call OpenSegment() again, which would take the lock again, resulting in a self-deadlock.
The solution is to release the lock before bumping epoch: the lock is only to protect the file list, which is already releasable at this point.
@badrishc badrishc merged commit e61e9be into microsoft:master Sep 16, 2020
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.

2 participants