-
Notifications
You must be signed in to change notification settings - Fork 815
Description
Original GitHub issue: googleapis/google-cloud-dotnet#12318
Diagnostic test solution: https://github.com/googleapis/google-cloud-dotnet/tree/main/issues/Issue12318
The most useful directory in there (in terms of looking at the code) is probably RawGrpcStubs.
Currently, I can reproduce this when talking to Firestore. I haven't managed to reproduce it with a local gRPC server - you can see attempts in the repro directory above, but they didn't come to anything.
The repro goes:
- Code: this is just the code generated by the vanilla C# protobuf generator and the gRPC plugin; it doesn't include the code we normally use for full Google client libraries ("GAPIC" code) or the handwritten Firestore code.
- Prework: Create a collection with 300 documents in (the PopulateCollection project does this if you want to repro yourself against Firestore)
- With a single FirestoreClient
- Call ListDocuments (a unary RPC) to get all the documents
- For each document, call Listen (a bidi streaming RPC), send a single request within that stream and observe whether we see any responses
- Wait for 10 seconds to give everything a chance to stabilize, then report results
I would expect every listener to receive a few responses - so we'd report at the end "We have 300 documents, and 300 listeners received a response."
What we actually see is:
- On Linux (.NET 6 and 8; not tested on 7), expected behavior
- On Windows 10 (.NET 6, 7 and 8), expected behavior
- On Windows 11, .NET 6, expected behavior
- On Windows 11, .NET 7, 8 and 9-preview: only 100 of the 300 listeners receive a response
I can give more version details if that would be useful - let me know exactly what's required.
Some experiments:
- Using a different client (with a different channel) for the initial unary RPC: all 300 listeners work. It's as if the initial unary call taints the channel somehow, stopping it from handling all 300 listeners, only handling 100 at a time.
- Running the "listen" part in multiple iterations: we get 100 active clients per iteration
- Explicitly specifying the HttpHandler as a SocketsHttpHandler with various options: doesn't seem to make a difference (experimented with EnableMultipleHttp2Connections and MaxConnectionsPerServer)
- Tried using nightly version 2.61.0-dev202404020702 (with Grpc.Auth 2.61.0) - still just 100 listeners with .NET 8
It's not clear to me what the next step is in terms of diagnosing this - any suggestions would be welcome.
Looking at logging, it looks like all 300 listeners manage to send their request, but then 200 of the 300 don't see any responses. In an earlier test I thought I'd seen only 100 listeners make a request, the rest being blocked - but I suspect that was a diagnostics failure.
I don't remember seeing a difference between Windows 10 and Windows 11 before when it comes to running .NET (as opposed to .NET Framework) code - and it's rare to spot differences from .NET 6 to later versions like this.