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

feat: deprecate 'KeepAlive::Until' globally #3880

Closed
wants to merge 3 commits into from

Conversation

drHuangMHT
Copy link
Contributor

@drHuangMHT drHuangMHT commented May 5, 2023

Description

Related: #3844

Notes & open questions

Breaking change: Swarm no longer process KeepAlive::Until timeout and will be treated the same as KeepAlive::Yes
Can be quite buggy.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@drHuangMHT
Copy link
Contributor Author

Test libp2p-swarm failed because default OneshotHandlerConfig has keep_alive_timeout of 10 seconds. When first-time polling returns Pending the handler won't be polled again, but the timer is set to 10 seconds after the first poll. The timer is not ready and the keep_alive flag is not set to No.

@thomaseizinger
Copy link
Contributor

Thanks for working on this!

Instead of using timers, I'd actually like our protocols to not keep connections alive unless they are doing work on them. Thus, the way I'd like #3844 to be implemented is by doing #3876 for each protocol.

Doing one PR per protocol would be great, as that allows us to bisect more easily in case we accidentally introduce a bug here.

Once all protocols are migrated away from Until, we can deprecate it and recommend our users to the same.

Does that make sense?

@drHuangMHT
Copy link
Contributor Author

Instead of using timers, I'd actually like our protocols to not keep connections alive unless they are doing work on them. Thus, the way I'd like #3844 to be implemented is by doing #3876 for each protocol.

Sure. Keeping a timer around can be quite troublesome.

@drHuangMHT
Copy link
Contributor Author

Close this as not planned.

@drHuangMHT drHuangMHT closed this May 5, 2023
@drHuangMHT drHuangMHT deleted the keepalive-deprecation branch July 3, 2023 01:00
@thomaseizinger thomaseizinger added this to the Simplify idle connection management milestone Sep 17, 2023
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