Skip to content

Personal/linuxsmiths/wait for ongoing flush must drain flush callback #162

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

Conversation

linuxsmiths
Copy link
Collaborator

No description provided.

else we can have a deadlock where write_iov_callback() first releases
the membuf lock which make wait_for_ongoing_flush() believe that all
flush are done and it can take the flush_lock safely, but write_iov_callback()
calls on_flush_complete() later which grabs the flush_lock. This can
cause a deadlock. The fix is to let the callback drain. Since
wait_for_ongoing_flush() is a rarely used function, we make that
check while write_iov_callback() can run w/o any additional check or
complexity.
Another way of solving this would be to release the membuf lock
after on_flush_complete() runs, but then it would have added unncessary
restrictions on what we can do insode on_flush_complete().
@linuxsmiths
Copy link
Collaborator Author

already merged

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.

1 participant