Skip to content

fix(client): cancel idle interval when pool empties - #292

Open
lrowe wants to merge 1 commit into
hyperium:masterfrom
lrowe:lrowe-cancel-idle-interval-when-empty
Open

fix(client): cancel idle interval when pool empties#292
lrowe wants to merge 1 commit into
hyperium:masterfrom
lrowe:lrowe-cancel-idle-interval-when-empty

Conversation

@lrowe

@lrowe lrowe commented Jun 12, 2026

Copy link
Copy Markdown

The IdleTask is started on first connection when pool_idle_timeout is set however it is not stopped when the pool is empty leaving the event loop spinning every pool_idle_timeout ms.

I noticed this in Deno (see: denoland/deno#29444) and the fix seems fairly small. Do you think such a change would be worth considering? Happy to work this up with test cases if so.

@Catwoman08

Copy link
Copy Markdown

This is tied to hyperium/hyper#4100

@Catwoman08
Catwoman08 requested a review from seanmonstar August 17, 2026 18:57
@seanmonstar

Copy link
Copy Markdown
Member

Yea, I think this is worth fixing. And it should "just work", a new connection will see None and start a new timer task. Some sort of unit test would be good to add to the legacy pool module.

@seanmonstar seanmonstar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just needs a test, I think.

@lrowe
lrowe force-pushed the lrowe-cancel-idle-interval-when-empty branch from e82b31f to 42d0315 Compare August 17, 2026 23:30
@lrowe
lrowe marked this pull request as ready for review August 17, 2026 23:31
@lrowe

lrowe commented Aug 17, 2026

Copy link
Copy Markdown
Author

I've added an assert to test_pool_timer_removes_expired that idle_interval_ref.is_none().

@lrowe
lrowe requested a review from seanmonstar August 17, 2026 23:33
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.

3 participants