net: reactor never parks on mempool inner - #320
Merged
Conversation
commit_after_script re-checks from PreparedAdmit.chain_coins and the graph. park_orphan treats any non-mempool input as missing. Hub write locks can now cover graph mutation without Query IO.
Session INV/getdata/compact use try_read (busy write skips that item). Accept, package, orphan promote, and reorg strip drop the write lock before Query/scripts. Compact fill siphashes live ids and clones matching bodies only. Blocking inner read/write asserts not-reactor.
JoinOnDrop no longer condvar-waits on the tokio worker. tip-accept still runs the job; a cancelled peer does not need the result.
concurrency.md owns the lock/role facts. CHANGELOG Unreleased notes the freeze-class fix.
spawn_blocking threads are named tokio-rt-worker. WS announce frames called get_tx without BlockingRegion and tripped the inner-read assert. Mempool /fee-estimates HTTP now uses the same spawn_join path. Electrum scripthash restatus already spawned blocking; it now enters the region.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PID 4026939 (tip-follow, ~10h): tokio reactor parked in
innerlock_slowwhile blocking-pool accept held write across Query. Lasttip: perfthen 7.5h silence. #316 movedaccept_txoff the reactor; INV/getdata stillinner.read(), and commit/promote still Query under write.What
commit_after_script/park_orphanare graph-only. Hub promote, package, reorg strip, andevict_after_reorgdrop write before Query/scripts.try_read: session INV / getdata / compact never park. Busy write skips that item (re-getdata / notfound / reconstruct without those txs).list_live()of the whole mempool.spawn_blocking.innerread/write asserts not-reactor.tip-acceptjoin detaches (does not condvar-wait on the worker).Lock facts live only in
docs/concurrency.md.Test plan
cargo test -p rbitcoin-mempool --libcargo test -p rbitcoin-net --lib(pins: Query not under write,
try_containson worker, blockingcontainspanics on worker, compactlist_live=0, JoinOnDrop detach)Do not merge unless asked.