Skip to content

Conversation

Chain-Fox
Copy link

This patch fixes a possible deadlock caused by conflicting lock order in src/log.rs:

clear_logs end_record
overlays.write()
appending.write()
appending.write()//deadlock!
overlays.write()//deadlock!

The fix is to lift the overlays.write() above appending.write() in end_record().

@arkpar
Copy link
Member

arkpar commented Jun 8, 2020

Thank you for detecting this. Even though clear_logs is never called in parallel with end_record this might change in the future. Proposed fix is suboptimal though. Calling to_file is expensive and the overlay lock should not be taken at this time.

I've fixed clear_log in 87abacb instead.

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