AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 16 Bitcoin

Fix hang in `test_single_channel_multiple_mpp` on busy machines

Public commit record

What the developer wrote

Authored by Matt Corallo

100/100 · Strong
Fix hang in `test_single_channel_multiple_mpp` on busy machines

`test_single_channel_multiple_mpp` claims an MPP payment from a
background thread while each `ChannelMonitorUpdate` persistence blocks
until the test sends into an mpsc channel. The claiming thread holds
node 8's per-peer lock while blocked, so the main thread can only take
that lock in the brief window after each update completes.

To fetch the first `commitment_signed`, the main thread called
`get_and_clear_pending_msg_events`, which takes the per-peer lock four
separate times. Only three updates were completed before it had to
return, and under CPU contention the main thread may get the lock only
once per update. It then stayed blocked on the lock while the claiming
thread waited for a write which only a thread spawned after the call
returns would send, hanging the test forever.

Instead, read the pending messages from the peer state directly,
taking the lock only once. Further, complete updates from a background
thread until each call returns, rather than a fixed number of times.
At least two are still completed while fetching the messages, so that
some claims are in the holding cell when the `revoke_and_ack` arrives.
Finally, accept any number of fulfills in each batch at the end, as
that depends on how far the claim got before the `revoke_and_ack` was
handled.

This may or may not be a complete fix, and may or may not make the
test unable to detect the original issue, but at this point it hardly
matters. We want to drop the test entirely in #4552 and its been racy
for so long that its starting to cause other issues.

Fixes #4744

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This change fixes a flaky automated test that could freeze forever on heavily loaded computers. It only touches test code, not the actual Lightning node software that users run, so it has no direct security impact on real deployments.

Recommended action

No security action required. Treat as routine test reliability improvement. If reviewing, confirm no production code paths are altered and that the test still exercises the intended MPP holding-cell behavior before removal in #4552.

Security signals we found

01

Concurrency/locking change in test code only

02

No production code modified

03

No input validation, cryptography, or network parsing changes

04

Commit message describes test hang, not a runtime vulnerability

Risk score

Why this scored 16/100

Our methodology →
Potential impact 2/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 9/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.