Repository navigation
Conversation
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.
|
when will this fix be merged into the release branch? |
|
|
@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. |
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.) |
|
@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. |
Motivation
Fixes #2522.
When
max_connection_ageis set withoutmax_connection_age_grace, the server panicswith
async fn resumed after completionon a tokio-rt-worker thread. TheGracefulShutdownbranch
in the
select!loop does not break, so the already-completedconnection_timeoutfuturegets 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_timeoutinFuse(the same pattern already used forsig) so thatre-polling after completion returns
Poll::Pendinginstead of panicking.Added a regression test that reproduces the exact scenario: poll after
GracefulShutdown.