-
Notifications
You must be signed in to change notification settings - Fork 766
-
Notifications
You must be signed in to change notification settings - Fork 766
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
gRPC Streaming From C# Resulting in GoAway error from server #2358
Comments
I should mention that we tried passing a custom |
Hi This is the same problem as #2361. You can read that issue for more details. Adding this code to the start of the client app disables RTT pings fixes the problem: AppContext.SetSwitch("System.Net.SocketsHttpHandler.Http2FlowControl.DisableDynamicWindowSizing", true); |
@psbang are you using .NET 6.0 or would a fix in .NET 8.0 be sufficient for you? |
In the solution attached below, we're trying to make gRPC requests to the Google GenerativeAI API, which is supposed to return a streaming response. However, this is inconsistently successful, as a significant fraction of the streaming responses are cut short with a GoAway error (seen in the txt output file also attached below). In the output, you can see the GoAway comes with output frame 13, but we have noticed that the frame number at which this happens, if at all, is also not consistent.
To reproduce our issue, install open the console app included in the attached ZIP file. You will need an API key from https://ai.google.dev/tutorials/setup and fill it in where the
// TODO
is. Then, run the console app. The app will make 100 calls to the generative AI API with a pre-filled prompt, and at the end you will see how many calls failed (ranges from anywhere between 1 failure to up to 26). I create the proto file using the structures I need from the publicly available protobuf here.The gRPC calls to this server are consistently successful from the Python client, but we haven't gotten it to succeed 100% of the time with C#. We believe that there might be a flag or header that we're missing to prevent the server from sending us the GoAway, but we don't know what it could be. Please advise.
GrpcStream.zip-20240111T225040Z-001.zip
SampleGrpcStreamOutput.txt
The text was updated successfully, but these errors were encountered: