Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quinn: endpoint_wait_idle failing test #2146

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ramfox
Copy link

@ramfox ramfox commented Jan 29, 2025

I found what I think is a bug in quinn, and this PR adds a test illustrating the bug.

The endpoint_wait_idle test shows that if an endpoint attempts to connect to an address, but the connection never gets beyond the Connecting stage, it causes the wait_idle call (when trying to gracefully shutdown the endpoint) to always take around 3s to return.

I ran into this personally when a call to Endpoint::connect was made in a task that was aborted early. Suddenly, calls to wait_idle were taking around 3s, when they were previously <200ms.

I'm hoping to get insight on to what could be causing this, so that either I can take a stab at fixing, or someone with more quinn experience can.

The `endpoint_wait_idle` test illustrates that if an endpoint attempts to connect to an address, but the connection never gets beyond the `Connecting` stage, it causes the `wait_idle` call (when trying to gracefully shutdown the endpoint) to always take around 3s to return.

This can occur if an `Endpoint::connect` call is made in a task that gets aborted early. Even if the `Connecting` struct is dropped, something is not cleaned up inside of the `Endpoint`. I suspect it has to do with inserting a `ConnectionHandle` in the `ConnectionSet` on the `RecvState`.
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.

1 participant