fix(transport): wrap connection_timeout in Fuse to prevent panic on#2588
Open
nerjs wants to merge 2 commits intohyperium:masterfrom
Open
fix(transport): wrap connection_timeout in Fuse to prevent panic on#2588nerjs wants to merge 2 commits intohyperium:masterfrom
nerjs wants to merge 2 commits intohyperium:masterfrom
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.