Skip to content

fix(pool): don't let a stale Singled cancel a new connect - #350

Merged
seanmonstar merged 2 commits into
hyperium:masterfrom
patrick-immometrica:fix-singleton-stale-clear
Nov 17, 2026
Merged

seanmonstar merged 2 commits into
hyperium:masterfrom
patrick-immometrica:fix-singleton-stale-clear

Conversation

@patrick-immometrica

Copy link
Copy Markdown
Contributor

When several requests hold the same cached service and it dies, each of them clears the singleton from poll_ready. If a new connect started in between, a later holder resets the Making state, and the connecting future then hits the unreachable!() in SingletonFuture::poll.

Only reset the state when it still holds a made service.

When several requests hold the same cached service and it dies, each of
them clears the singleton from poll_ready. If a new connect started in
between, a later holder resets the Making state, and the connecting
future then hits the unreachable!() in SingletonFuture::poll.

Only reset the state when it still holds a made service.
A Singled that outlives its connection could still clear a newer, healthy
service from the cache when its poll_ready errored, forcing a needless
reconnect.

Tag each made service with the generation of the batch that made it, and
have Singled clear the state only while it still holds that generation.
@seanmonstar
seanmonstar merged commit 1e50e91 into hyperium:master Nov 17, 2026
20 checks passed
@patrick-immometrica
patrick-immometrica deleted the fix-singleton-stale-clear branch November 17, 2026 16:17
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