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

2.1.0-beta.1 deadlock fix #3063

Merged
merged 1 commit into from
Sep 28, 2019
Merged

Conversation

yeastplume
Copy link
Member

Can't entirely explain why this would have caused a threading deadlock, but debugging a stuck node showed 2 threads stuck trying to get a lock on the transaction pool at:

server.rs:480: stem_pool_size: self.tx_pool.read().stempool.entries.len()
dandelion_monitor.rs:159 - let mut tx_pool = tx_pool.write();

I'd conjecture it occurred for some Rusty reason when the write lock happened to be taken just after the first read lock.

Current fix:

  • Changes the tui read' to try_read`
  • Only attempt to read once (was no need to lock twice in the existing code)

I'd guess that only taking the lock once would have been enough to resolve, but no harm just using a try_read for tui purposes. Ran with these modifications overnight seems to resolve the freezing issues.

@yeastplume yeastplume merged commit f86eb18 into mimblewimble:master Sep 28, 2019
@antiochp
Copy link
Member

Nice catch with this.

👍

@yeastplume yeastplume deleted the freeze_fix branch January 6, 2020 10:05
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.

3 participants