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

fix(swarm): prevent overflow in keep-alive computation #4559

Merged
merged 11 commits into from
Sep 27, 2023

Conversation

thomaseizinger
Copy link
Contributor

Description

When adding a very large Duration to an Instant, an overflow can occur. To fix this, we check this before instantiating Delay and half the given duration until it no longer overflows.

Fixes: #4555.

Notes & open questions

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

@thomaseizinger thomaseizinger mentioned this pull request Sep 26, 2023
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Feel free to release right away.

swarm/CHANGELOG.md Outdated Show resolved Hide resolved
swarm/CHANGELOG.md Outdated Show resolved Hide resolved
swarm/src/connection.rs Outdated Show resolved Hide resolved
swarm/src/connection.rs Outdated Show resolved Hide resolved
@mergify mergify bot merged commit 9cd0f3d into master Sep 27, 2023
73 checks passed
@mergify mergify bot deleted the fix/overflow-in-keepalive branch September 27, 2023 07:38
@thomaseizinger
Copy link
Contributor Author

Just released! Thanks for the fix Max :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic on setting idle_connection_timeout() of SwarmBuilder with max value
2 participants