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

send keepalives to peers on a network change #176

Merged
merged 3 commits into from
Jun 28, 2024
Merged

Conversation

billiegoose
Copy link
Contributor

I can't see any difference with or without this change. Still seems like an ungodly long time (5-8 seconds) between NETWORK CHANGE and ...stream-close.

Can anyone else confirm / deny ?

Testing using my test/manual/measure-reconnect.js script and switching networks.
Note: I've even tried commenting out the conn.setKeepAlive(5000) line in test/manual/measure-reconnect.js to try and give this PR every advantage.

@billiegoose billiegoose self-assigned this Jun 21, 2024
@billiegoose billiegoose requested a review from mafintosh June 21, 2024 20:59
@billiegoose
Copy link
Contributor Author

@mafintosh - this works... ish. But it would probably work even better if we pessimistically began reconnecting to peers right away, then aborted the reconnecting if it turned out the connections were still alive. Got any ideas how to do that?

@mafintosh mafintosh marked this pull request as ready for review June 28, 2024 07:34
@mafintosh
Copy link
Contributor

Lets land this for now, making the call non optional

@billiegoose
Copy link
Contributor Author

For funsies I'm gonna test it real quick

@billiegoose
Copy link
Contributor Author

Eh, my LAN connections are still so slow I can't really measure an improvement. But I have a really hard time imagining this could have a detrimental unforeseen result so I feel safe to merge it.

@billiegoose billiegoose merged commit 9cd179c into main Jun 28, 2024
4 checks passed
@billiegoose billiegoose deleted the feat/fast-keep-alive branch June 28, 2024 12:55
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.

2 participants