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
Avoid writing ChannelManager
when hitting lnd bug 6039
#2937
Avoid writing ChannelManager
when hitting lnd bug 6039
#2937
Conversation
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.
dadd363
to
03425e4
Compare
Codecov ReportAttention: Patch coverage is
❗ 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. |
There was a problem hiding this 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.
@@ -9242,8 +9242,6 @@ where | |||
} | |||
|
|||
fn handle_error(&self, counterparty_node_id: &PublicKey, msg: &msgs::ErrorMessage) { | |||
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self); | |||
|
|||
match &msg.data as &str { | |||
"cannot co-op close channel w/ active htlcs"| | |||
"link failed to shutdown" => |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
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 writingChannelManager
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.