Skip to content

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

Closed
nerjs wants to merge 4 commits into
grpc:masterfrom
nerjs:panic-tokio-rt-worker
Closed

nerjs wants to merge 4 commits into
grpc:masterfrom
nerjs:panic-tokio-rt-worker

Conversation

@nerjs

@nerjs nerjs commented Apr 13, 2026

Copy link
Copy Markdown

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 3 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.
@FAKERINHEART

Copy link
Copy Markdown

when will this fix be merged into the release branch?

@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@nerjs

nerjs commented Jun 3, 2026 •

Copy link
Copy Markdown
Author

@FAKERINHEART, This PR will most likely not be merged - I don’t plan on signing the CLA (at least not yet). If you need it, feel free to use the fix or reopen it as your own PR. Sorry about that.

@dfawley

dfawley commented Jun 22, 2026

Copy link
Copy Markdown
Member

@nerjs,

This PR will most likely not be merged - I don’t plan on signing the CLA (at least not yet). If you need it, feel free to use the fix or reopen it as your own PR. Sorry about that.

Would you mind saying why? Is it because of this, perhaps?

linuxfoundation/easycla#4638 (comment)

(tl;dr: it seems there was a recent regression that made the CLA require a mailing address (again!), but that has been resolved.)

@nerjs

nerjs commented Jun 24, 2026

Copy link
Copy Markdown
Author

@dfawley thanks for looking into this. The address request did surprise me, but that's not really the reason. I'm not going to sign the CLA.

I opened this PR against the tonic repo and didn't expect such a small fix to turn into this kind of discussion.

I'm going to close it.
The fix is mainly something I need for a project I'm involved in, so I'd really appreciate it if someone from the community could pick it up and land it. It's a small change and it passes all checks.

@nerjs nerjs closed this Jun 24, 2026
LucioFranco pushed a commit that referenced this pull request Jul 30, 2026
)

This PR fixes #2522 using the exact same approach proposed in #2588,
which was closed before merging.
ewgenius pushed a commit to spiceai/grpc-rust that referenced this pull request Sep 15, 2026
…pc#2780)

This PR fixes grpc#2522 using the exact same approach proposed in grpc#2588,
which was closed before merging.
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

4 participants