Skip to content

fix(transport): wrap connection_timeout in Fuse to prevent panic on#2588

Open
nerjs wants to merge 2 commits intohyperium:masterfrom
nerjs:panic-tokio-rt-worker
Open

fix(transport): wrap connection_timeout in Fuse to prevent panic on#2588
nerjs wants to merge 2 commits intohyperium:masterfrom
nerjs:panic-tokio-rt-worker

Conversation

@nerjs
Copy link
Copy Markdown

@nerjs nerjs commented Apr 13, 2026

Motivation

Fixes #2522.

When max_connection_age is set without max_connection_age_grace, the server panics
with
async fn resumed after completion on a tokio-rt-worker thread. The GracefulShutdown
branch
in the select! loop does not break, so the already-completed connection_timeout future
gets polled again on the next iteration.

I ran into the same issue in production - the panic started appearing after upgrading to
0.14.5.

Solution

Wrap connection_timeout in Fuse (the same pattern already used for sig) so that
re-polling after completion returns Poll::Pending instead of panicking.

Added a regression test that reproduces the exact scenario: poll after GracefulShutdown.

nerjs added 2 commits April 13, 2026 10:10
re-poll

  connection_timeout_future was polled again after returning
  GracefulShutdown
  in the select! loop, causing "async fn resumed after completion"
  panic.
  Wraps it in Fuse (matching the existing sig pattern) and adds a
  regression test.
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.

async fn resumed after completion in serve_connection

1 participant