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

define Request.GetBody to avoid this error #541

Closed
pqn opened this issue Jul 3, 2023 · 7 comments
Closed

define Request.GetBody to avoid this error #541

pqn opened this issue Jul 3, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@pqn
Copy link

pqn commented Jul 3, 2023

Describe the bug

In some of our production logs we've noticed the following client error:

unavailable: http2: Transport: cannot retry err [http2: Transport received Server's graceful shutdown GOAWAY] after Request.Body was written; define Request.GetBody to avoid this error

To Reproduce

We've been unable to reproduce this locally.

Environment (please complete the following information):

  • connect-go version or commit: v1.6.0
  • go version: go version go1.20.5 linux/amd64
  • your complete go.mod: I can provide dependencies as needed

Additional context

@pqn pqn added the bug Something isn't working label Jul 3, 2023
@emcfarlane
Copy link
Contributor

Hey @pqn! Thanks for the detailed breakdown. For unary requests we should be able to set GetBody on requests as we have the body in a bytes.Buffer. However we currently write to the body with a pipe: https://github.com/bufbuild/connect-go/blob/main/duplex_http_call.go#L80
I'll try replicate this with testing and see if we can create a fix for unary requests. In the meantime you might be able to check for this error and retry on the client side. How often do you see this happening?

@pqn
Copy link
Author

pqn commented Jul 4, 2023

In one log I'm seeing it maybe 4-5 times in an hour.

@espadolini
Copy link

We see this error 10-40 times per minute in our prod infra out of roughly 2400 requests, so 0.4% to 1.6% of all requests are being retried, which isn't terrible but also not insignificant.

@pqn
Copy link
Author

pqn commented Jul 27, 2023

I saw #543 was closed. Just wondering, is this being worked on or in the backlog right now? Thanks!

@emcfarlane
Copy link
Contributor

Hey @pqn, we are still aiming to fix this issue soon. The feedback on the PR was to focus on the unary changes first as this will have the largest impact. @mattrobenolt has some good suggestion on splitting out the unary flow to get some nice performance improvements too. Will be a much neater solution!

@pqn
Copy link
Author

pqn commented Jul 28, 2023

Sounds good! Thanks for the update.

@jhump
Copy link
Member

jhump commented Jan 22, 2024

Resolved in #649, but only for unary-request RPCs (which includes both unary RPCs and server-streaming RPCs). Implementing GetBody for streaming requests is more complicated, and not as high of a priority since unary operations are the vast majority of RPC usage.

I've opened a separate issue (#672) to track the state of addressing this same issue with streaming RPCs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants