-
Notifications
You must be signed in to change notification settings - Fork 51
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
chore: test peer connection management #3049
base: master
Are you sure you want to change the base?
Conversation
You can find the image built from this PR at
Built from 6289957 |
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.
Looks amazing! Thanks so much!
Added a small question :)
reconnectDurationWithBackoffPeriod > | ||
(reconnectDuration + backoffPeriod.seconds.float) |
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.
Not sure I understand why this is true. Shouldn't they be theoretically equal, but in practice any of them be longer than the other one?
Or in other words, why reconnectDuration + backoffPeriod.seconds.float
can't be greater than reconnectDurationWithBackoffPeriod
?
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.
Not sure I understand why this is true. Shouldn't they be theoretically equal, but in practice any of them be longer than the other one?
Or in other words, why
reconnectDuration + backoffPeriod.seconds.float
can't be greater thanreconnectDurationWithBackoffPeriod
?
Actually, in both cases we are doing the same operation but, in when the backoff
time assigned is != 0, then we add this extra block:
if backoffTime > ZeroDuration:
debug "Backing off before reconnect",
peerId = peerInfo.peerId, backoffTime = backoffTime
# We disconnected recently and still need to wait for a backoff period before connecting
await sleepAsync(backoffTime)
... where we are adding an extra backoffTime
plus the time spent in the debug
call plus the if statement. Hence, the >
condition should happen.
Description
Enhance reconnect logic and fix reconnect tests.
The important point is that it is necessary to set a port different than zero in tests.
Changes
Issue
closes