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

Bookkeeping bug in HttpConnectionPool when handling an HTTP/2 => HTTP/1.1 downgrade #99401

Closed
MihaZupan opened this issue Mar 7, 2024 · 1 comment · Fixed by #99402
Closed
Assignees
Milestone

Comments

@MihaZupan
Copy link
Member

Noticed this one while cleaning up #99364

If we try to downgrade an HTTP/2 connection to HTTP/1.1 and we're already at the connection limit, we'll throw away the new connection.

When doing so, we'll set canUse to false and dispose the stream.

But then we'll still try to construct an HTTP/1.1 stream out of it and eventually handle its failure, which will lead us to decrement the _associatedHttp11ConnectionCount and _pendingHttp11ConnectionCount counters that we never incremented for this connection in the first place, leaving them off by 1.

It looks like we're just missing a return here.

if (!canUse)
{
if (NetEventSource.Log.IsEnabled()) Trace("Discarding downgraded HTTP/1.1 connection because HTTP/1.1 connection limit is exceeded");
stream.Dispose();
}

Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@MihaZupan MihaZupan self-assigned this Mar 7, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant