ASP.NET core GRPC server can terminate connections when MAX_CONCURRENT_STREAMS
is breached
#673
Labels
bug
Something isn't working
MAX_CONCURRENT_STREAMS
is breached
#673
What version of gRPC and what language are you using?
grpc=v2.24.0
lang=C#
What operating system (Linux, Windows,...) and version?
Windows, v10.0.18362 Build 18362
What runtime / compiler are you using (e.g. .NET Core SDK version
dotnet --info
)v3.0.100
What did you do?
When issuing many requests on a fresh/ idle connection, it's possible to exceed the
MAX_CONCURRENT_STREAMS
setting of a server, causing the connection to fault and failing successfully processed streams.Exceeding the
MAX_CONCURRENT_STREAMS
on a fresh/ idle connection should be supported as the initial value is assumed to be unlimited until a peer has communicated it's prefered limit.This psuedo-code highlights how to re-create the issue on the client-side:
MAX_CONCURRENT_STREAMS
should be set to a low value in the ASP.NET grpc server (inappsettings.json
):What did you expect to see?
The streams that exceed the
MAX_CONCURRENT_STREAMS
limit should be closed and anyDATA
frames received by the server for these streams should result in aSTREAM_CLOSED
error as per the HTTP/2 RFC:What did you see instead?
Streams that exceed the
MAX_CONCURRENT_STREAMS
hadDATA
frames in-flight which resulted in the entire TCP connection being torn down:The impact of faulting the entire connection is that some requests may have successfully processed and their
CancellationToken
may not trigger- this means it's impossible to recover from this kind of error gracefully.Anything else we should know about your project / environment?
The text was updated successfully, but these errors were encountered: