Skip to content
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

Test for extra locks held in handle_error unconditionally #2158

Conversation

TheBlueMatt
Copy link
Collaborator

handle_error must be called without per_peer_state mutex or pending_events mutex locks held or we may risk deadlocks. Previously we checked this in debug builds in the error path, but not in the success path.

As it turns out, funding_transaction_generated's error path does hold a per_peer_state lock, which we fix here as well as move the tests to happen unconditionally.

`handle_error` must be called without `per_peer_state` mutex or
`pending_events` mutex locks held or we may risk deadlocks.
Previously we checked this in debug builds in the error path, but
not in the success path.

As it turns out, `funding_transaction_generated`'s error path does
hold a `per_peer_state` lock, which we fix here as well as move the
tests to happen unconditionally.
@TheBlueMatt TheBlueMatt added this to the 0.0.115 milestone Apr 6, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 6, 2023

Codecov Report

Patch coverage: 78.57% and project coverage change: +0.50 🎉

Comparison is base (8fcbe64) 91.30% compared to head (9e6e20f) 91.81%.

📣 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    #2158      +/-   ##
==========================================
+ Coverage   91.30%   91.81%   +0.50%     
==========================================
  Files         102      102              
  Lines       49927    54196    +4269     
  Branches    49927    54196    +4269     
==========================================
+ Hits        45586    49760    +4174     
- Misses       4341     4436      +95     
Impacted Files Coverage Δ
lightning/src/ln/channelmanager.rs 91.53% <78.57%> (+2.40%) ⬆️

... and 9 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.

dunxen
dunxen previously approved these changes Apr 6, 2023
wpaulino
wpaulino previously approved these changes Apr 7, 2023
lightning/src/ln/channelmanager.rs Outdated Show resolved Hide resolved
@TheBlueMatt TheBlueMatt dismissed stale reviews from wpaulino and dunxen via 9e6e20f April 7, 2023 04:54
@valentinewallace valentinewallace merged commit 186cd04 into lightningdevkit:main Apr 7, 2023
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.

5 participants