Skip to content

Commit 1829dc9

Browse files
jkczyzclaude
andcommitted
Fix thread starvation in test_single_channel_multiple_mpp
The busy-wait loop polling for PaymentClaimed events had no yield, causing it to continuously acquire ChannelManager locks via get_and_clear_pending_events(). This could starve the claim_funds thread of lock access, preventing it from ever queuing the event. Add a yield_now() call matching the pattern used by the other two spin loops in this test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 817ab5e commit 1829dc9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4715,6 +4715,9 @@ fn test_single_channel_multiple_mpp() {
47154715
}
47164716
have_event = true;
47174717
}
4718+
if !have_event {
4719+
std::thread::yield_now();
4720+
}
47184721
}
47194722
});
47204723

0 commit comments

Comments
 (0)