Skip to content

Conversation

@TheBlueMatt
Copy link
Collaborator

When we hit lnd bug 6039, we end up sending error messages to peers in a loop. This should be fine, but because we used the generic PersistenceNotifierGuard::notify_on_drop lock above the specific handling, we end up writing ChannelManager every time we manage a round-trip to our peer.

This can add up quite quickly, and isn't actually changing, so we really need to avoid writing the ChannelManager in this case.

@G8XSU
Copy link
Contributor

G8XSU commented Mar 14, 2024

Build failure: ln::shutdown_tests::test_lnd_bug_6039

When we hit lnd bug 6039, we end up sending error messages to peers
in a loop. This should be fine, but because we used the generic
`PersistenceNotifierGuard::notify_on_drop` lock above the specific
handling, we end up writing `ChannelManager` every time we manage a
round-trip to our peer.

This can add up quite quickly, and isn't actually changing, so we
really need to avoid writing the `ChannelManager` in this case.
@TheBlueMatt TheBlueMatt force-pushed the 2024-03-no-wake-on-shutdown branch from dadd363 to 03425e4 Compare March 14, 2024 20:03
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 90.62500% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 89.20%. Comparing base (f5ee8c2) to head (03425e4).
Report is 2 commits behind head on main.

Files Patch % Lines
lightning/src/ln/channelmanager.rs 90.62% 1 Missing and 2 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2937      +/-   ##
==========================================
- Coverage   89.20%   89.20%   -0.01%     
==========================================
  Files         117      117              
  Lines       95513    95522       +9     
  Branches    95513    95522       +9     
==========================================
+ Hits        85203    85209       +6     
- Misses       7822     7831       +9     
+ Partials     2488     2482       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@G8XSU G8XSU left a comment

Choose a reason for hiding this comment

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

Lgtm!
Waiting for CI to approve.
To me it looks safe, your call to wait for another reviewer or not.


match &msg.data as &str {
"cannot co-op close channel w/ active htlcs"|
"link failed to shutdown" =>
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated: is it safe to rely on these string messages?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the worst case lnd changes the messages and we force-close instead of sending a repeated shutdown, so...it should be?

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