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

Better randomization of reconnection delay #1250

Merged
merged 2 commits into from
Dec 11, 2019
Merged

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Dec 11, 2019

Randomization is necessary, otherwise if two peers attempt to reconnect
to each other in a synchronized fashion, they will enter in a
disconnect-reconnect loop.

We already had randomization for the initial reconnection attempt, but
further reconnection attempts were using a deterministic schedule
following an exponential backoff curve.

Fixes #1238.

Randomization is necessary, otherwise if two peers attempt to reconnect
to each other in a synchronized fashion, they will enter in a
disconnect-reconnect loop.

We already had randomization for the initial reconnection attempt, but
further reconnection attempts were using a deterministic schedule
following an exponential backoff curve.

Fixes #1238.
@pm47 pm47 requested review from araspitzu and t-bast December 11, 2019 12:23
Copy link
Contributor

@araspitzu araspitzu left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-io
Copy link

codecov-io commented Dec 11, 2019

Codecov Report

Merging #1250 into master will increase coverage by 0.03%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master    #1250      +/-   ##
==========================================
+ Coverage   76.66%   76.69%   +0.03%     
==========================================
  Files         140      140              
  Lines        9702     9703       +1     
  Branches      376      380       +4     
==========================================
+ Hits         7438     7442       +4     
+ Misses       2264     2261       -3
Impacted Files Coverage Δ
...-core/src/main/scala/fr/acinq/eclair/io/Peer.scala 75.59% <50%> (+0.07%) ⬆️
...src/main/scala/fr/acinq/eclair/router/Router.scala 92% <0%> (-0.72%) ⬇️
...nq/eclair/blockchain/electrum/ElectrumWallet.scala 81% <0%> (+0.25%) ⬆️
...q/eclair/blockchain/electrum/ElectrumWatcher.scala 51.72% <0%> (+1.72%) ⬆️
...clair/blockchain/electrum/ElectrumClientPool.scala 78.49% <0%> (+4.3%) ⬆️

@pm47 pm47 merged commit e1c48eb into master Dec 11, 2019
@pm47 pm47 deleted the initial-reconnect-delay branch December 11, 2019 13:16
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.

Long series of reconnects followed by force-close
4 participants