-
Notifications
You must be signed in to change notification settings - Fork 411
Suggest faster ping in PeerManager::timer_tick_occurred
docs
#1035
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
Suggest faster ping in PeerManager::timer_tick_occurred
docs
#1035
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1035 +/- ##
==========================================
+ Coverage 90.84% 92.11% +1.27%
==========================================
Files 61 61
Lines 31534 36953 +5419
==========================================
+ Hits 28646 34040 +5394
- Misses 2888 2913 +25
Continue to review full report at Codecov.
|
Tagging 0.0.100 cause this is super trivial and a user asked for it. |
23fc049
to
d519609
Compare
Added an additional commit to handle being in the background for too long. This should resolve issues iOS users have seen where the app is in the background for some time and sockets are actually disconnected but we don't know that as we've been offline for a while. This PR is somewhat higher priority for this reason. |
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.
Just nits. LGTM!
peer_manager.timer_tick_occurred(); | ||
peer_manager.timer_tick_occurred(); |
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.
It reads to me as odd to disconnect peers this way, rather than explicitly through some disconnect_peer()
or so API
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.
Right, to some extent I agree, but at the same times its what has happened - the timer should have fired twice, so that's just what we do. The PeerManager
could in the future tweak how it handles timer events and I think this would be more correct.
/// Send pings to each peer and disconnect those which did not respond to the last round of | ||
/// pings. | ||
/// | ||
/// This may be called on any timescale you want, however, roughly once every five to ten |
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.
nit: s/want, however,/want. However,
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.
Don't think it needs a new sentence here?
7a273ed
to
0c6637e
Compare
This clarifies the docs for `PeerManager::timer_tick_occurred` to note that the call rate is entirely up to the user, and also suggests a faster ping rate of "once every five to ten seconds" instead of "every 30 seconds". There isn't a lot of reason to want to ping less often, and faster ping means we detect disconnects sooner, which is important.
This updates lightning-background-processor calls to PeerManager::timer_tick_occurred to match the new suggested rate in the documentation.
If we've been asleep for double our ping time, for whatever reason, disconnect all open sockets.
0c6637e
to
0f1a3b1
Compare
Squashed. Will merge after CI. Full diff from Jeff's ACK is:
|
This clarifies the docs for
PeerManager::timer_tick_occurred
tonote that the call rate is entirely up to the user, and also
suggests a faster ping rate of "once every five to ten seconds"
instead of "every 30 seconds". There isn't a lot of reason to want
to ping less often, and faster ping means we detect disconnects
sooner, which is important.