Skip to content

Use signal for handling ChannelPending in test_background_event_handling #2165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

wpaulino
Copy link
Contributor

@wpaulino wpaulino commented Apr 6, 2023

This fixes two potential panics within the test if the BackgroundProcessor for nodes[0] consumed the ChannelPending event prior to us consuming it manually in end_open_channel. The first panic would happen within the event handler, since ChannelPending was not being handled. The second panic would happen upon expecting the ChannelPending event after handling nodes[1]'s funding_signed if the BackgroundProcessor handled the event first. To ensure we still reliably receive a ChannelPending event once possible, we let the BackgroundProcessor consume the event and notify it.

Fixes #2144.

This fixes two potential panics within the test if the
`BackgroundProcessor` for `nodes[0]` consumed the `ChannelPending` event
prior to us consuming it manually in `end_open_channel`. The first panic
would happen within the event handler, since `ChannelPending` was not
being handled. The second panic would happen upon expecting the
`ChannelPending` event after handling `nodes[1]`'s `funding_signed` if
the `BackgroundProcessor` handled the event first. To ensure we still
reliably receive a `ChannelPending` event once possible, we let the
`BackgroundProcessor` consume the event and notify it.
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (5c6a39b) 91.30% compared to head (5037298) 91.29%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2165      +/-   ##
==========================================
- Coverage   91.30%   91.29%   -0.01%     
==========================================
  Files         102      102              
  Lines       49981    49987       +6     
  Branches    49981    49987       +6     
==========================================
+ Hits        45636    45638       +2     
- Misses       4345     4349       +4     
Impacted Files Coverage Δ
lightning-background-processor/src/lib.rs 77.10% <100.00%> (+0.32%) ⬆️

... and 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, thank you!

@TheBlueMatt TheBlueMatt merged commit c8441d2 into lightningdevkit:main Apr 7, 2023
@wpaulino wpaulino deleted the fix-bp-channel-pending-panic-flake branch April 7, 2023 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

background-processor tests are flaky
4 participants