Fix thread starvation in test_single_channel_multiple_mpp#4396
Fix thread starvation in test_single_channel_multiple_mpp#4396TheBlueMatt merged 1 commit intolightningdevkit:mainfrom
test_single_channel_multiple_mpp#4396Conversation
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>
|
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
|
I asked Claude to fix this hanging test. This is what it came up with for a plan: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4396 +/- ##
==========================================
+ Coverage 86.01% 86.03% +0.01%
==========================================
Files 156 156
Lines 102857 103091 +234
Branches 102857 103091 +234
==========================================
+ Hits 88476 88691 +215
- Misses 11871 11889 +18
- Partials 2510 2511 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
TheBlueMatt
left a comment
There was a problem hiding this comment.
shitty mutex impl for this to hang, but it won't hurt so why not.
|
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
The busy-wait loop polling for
PaymentClaimedevents had no yield, causing it to continuously acquireChannelManagerlocks viaget_and_clear_pending_events(). This could starve theclaim_fundsthread of lock access, preventing it from ever queuing the event. Add ayield_now()call matching the pattern used by the other two spin loops in this test.