Skip to content

Panic when pool idle timeout set to zero #2997

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

Closed
Seeker14491 opened this issue Sep 28, 2022 · 1 comment
Closed

Panic when pool idle timeout set to zero #2997

Seeker14491 opened this issue Sep 28, 2022 · 1 comment
Labels
C-bug Category: bug. Something is wrong. This is bad!

Comments

@Seeker14491
Copy link

Version
hyper v0.14.20, h2 v0.3.14, tokio v1.21.2

Platform
Linux seekr-xps15-zorin 5.13.0-35-generic #40~20.04.1-Ubuntu SMP Mon Mar 7 09:18:32 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Description
Passing in Some(Duration::ZERO) to hyper::client::Builder::pool_idle_timeout() can lead to a panic. The panic happens in the tokio::time::interval() function, which disallows specifying a zero duration.

I have switched my code to use builder.pool_max_idle_per_host(0) instead, which works properly.

@Seeker14491 Seeker14491 added the C-bug Category: bug. Something is wrong. This is bad! label Sep 28, 2022
0x676e67 added a commit to 0x676e67/hyper2 that referenced this issue Oct 20, 2023
0x676e67 added a commit to 0x676e67/hyper2 that referenced this issue Aug 11, 2024
* Add more SETTINGS frame options

* Disable the default frame

* fix(http): divide by zero error when dividing duration by scalar

Consider addrs length is 0.

From issue: seanmonstar/reqwest#2003

* fix(client): panic when pool idle timeout set to zero

From issue: hyperium/hyper#2997

* deps(h2): bump version to v0.4.2

* deps(http-body): bump version to v0.4.6

* deps(httpdate): bump version to v1.0.3

* feat(client): Add reset connection pool idle status

* feat(client): export deref to connector

* feat: Allow binding interface (#3)

* deps(lib): Export `h2::profile::AgentProfile` (#5)

* deps(http): Pin version v0.2

---------

Co-authored-by: 4JX <[email protected]>
@grodin
Copy link

grodin commented Feb 3, 2025

Resolved by #3365 but the issue was missed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug. Something is wrong. This is bad!
Projects
None yet
Development

No branches or pull requests

3 participants