Skip to content

add block_hash to head_info so we can easily use them later#3060

Merged
antiochp merged 1 commit into
mimblewimble:masterfrom
antiochp:more_stats_less_deadlock
Sep 26, 2019
Merged

add block_hash to head_info so we can easily use them later#3060
antiochp merged 1 commit into
mimblewimble:masterfrom
antiochp:more_stats_less_deadlock

Conversation

@antiochp
Copy link
Copy Markdown
Member

I suspect the header_mmr.read() lock in get_server_stats is causing issues as every peer thread needs write access to the header_mmr for processing blocks and block headers.

I have seen anecdotal evidence that something is causing a deadlock and gdb indicates the stuck tui is blocked waiting on a read() lock. Just not 100% sure which read lock, but this is a likely candidate).

There is no need to lock the header_mmr here just to read several headers by height to find their block hashes. It makes more sense to simply track these block hashes when we build the difficulty iterator initially.
We also update the tui stats every 1s or so, which introduces the potential for lock contention on this header_mmr via the tui thread.

Currently running a node on mainnet with these changes applied and TUI enabled. I'd like to let this run for a bit to see if we can still reproduce the deadlock scenario or if these changes do appear to alleviate the issue.

@antiochp antiochp added this to the 2.1.0 milestone Sep 26, 2019
@antiochp antiochp added the bug label Sep 26, 2019
@antiochp
Copy link
Copy Markdown
Member Author

This has not made anything worse and it should definitely have some benefits with tui updates being less resource intensive. So I'm going to merge this.

@antiochp antiochp merged commit fc4e298 into mimblewimble:master Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants