-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
H2C connection to HTTP.sys on localhost causes infinite loop #42259
Comments
Tagging subscribers to this area: @dotnet/ncl |
Triage: @JamesNK do you know how common this scenario is for gRPC? We are considering moving it to Future. |
Using H2C with gRPC is very common. Is this bug specific to HTTP.sys as a server, or is it a problem when doing H2C in general? |
We do not know. That said, if it wasn't reported on gRPC yet, I think it is safe to assume that either the scenario is rare, or that it works outside of HTTP.sys. |
This code (retry logic and connection construction) has been substantially reworked and the culprit: |
If
ProcessIncommingFrames
encounters an exception it tries to abort the HTTP 2 connection: https://github.com/dotnet/runtime/blob/master/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs#L394. This will remove it from the connection pool. But if this happens synchronously fromSetupAsync
, the connection is not yet in the pool and still gets added: https://github.com/dotnet/runtime/blob/master/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs#L642-L644.As a result, any subsequent requests will end up in an infinite loop in
SendWithRetryAsync
sinceisNewConnection
will befalse
: https://github.com/dotnet/runtime/blob/master/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs#L913The text was updated successfully, but these errors were encountered: