Review report

bitcoin/bitcoin: PR #36266

1 minor finding · 1 suggestion

Findings

Link

[minor] · Active-command polling races with guard acquisition

The concurrency test can fail despite correct serialization if the FIFO worker stalls between active-command registration and guard acquisition.

Location: test/functional/rpc_dumptxoutset.py:70 (head).

Details and suggested fix

ExecuteCommand publishes the request in active_commands before invoking the RPC actor, while DumptxoutsetGuard is acquired inside that actor. With the fixture's two RPC workers, a scheduling stall between those steps lets the other worker answer getrpcinfo and then successfully execute the foreground latest dump to its unused path. The FIFO blocks only after the background request takes the guard, so it does not close this window. No failing run has been observed. Emit a log marker after guard acquisition and before fopen, then start the background thread inside node.assert_debug_log([...], timeout=...) and issue the foreground call after that context exits. Do not poll with another dumptxoutset as a readiness probe, since that probe can acquire the guard and reject the FIFO request instead.


Optional improvements

Link

[suggestion] · Stale-target test misses late-rejection regressions

The stale-target test would still pass if rejection occurred only after copying the UTXO set and rolling back.

Location: test/functional/rpc_dumptxoutset.py:56 (head).

Details and suggested fix

The current ancestry check runs before cursor creation, but the new test checks only the -8 response and cleanup. Moving that check immediately before the final CHECK_NONFATAL would still satisfy both assertions after copying the UTXO set and rolling back, because DumptxoutsetGuard removes the incomplete file on failure. Deleting the check entirely is already detected by the different error. Wrap just the stale-target RPC in with node.assert_debug_log([], unexpected_msgs=["UTXO set copy complete:", "Rolling back from height"]): to catch that late-rejection regression. The RPC is synchronous, so this needs no timeout. Allow the initial Copying current UTXO set to temporary database. message, which currently appears before the ancestry check.


Coverage details