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

rpc: set Request.GetBody for client requests #24292

Merged
merged 1 commit into from Jan 27, 2022

Conversation

ValentinTrinque
Copy link
Contributor

@ValentinTrinque ValentinTrinque commented Jan 25, 2022

When talking to an HTTP2 server, there are situations where it needs to "rewind" the Request.Body.
To allow this, we have to set up the Request.GetBody function to return a brand new instance of the body.

If not set, we can end up with the following error:

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

Commit :
https://sourcegraph.com/github.com/golang/net/-/commit/cffdcf672aee934982473246bc7e9a8ba446aa9b?visible=2

Close #24291

…quest.Body on retry

When talking to an HTTP2 server, there are situations where it needs to to "rewind" the Request.Body.
To allow this, we have to set up the Request.GetBody function to return a brand new instance of the body.

If not set, we can end up with the following error:
```
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
```

Commit :
https://sourcegraph.com/github.com/golang/net/-/commit/cffdcf672aee934982473246bc7e9a8ba446aa9b?visible=2
@fjl fjl changed the title Set Request.GetBody to ensure HTTP2 transport layer can rewind the Request.Body on retry rpc: set Request.GetBody for client requests Jan 25, 2022
@fjl fjl added this to the 1.10.16 milestone Jan 25, 2022
@fjl
Copy link
Contributor

fjl commented Jan 25, 2022

Thanks!

mslipper added a commit to mslipper/optimism that referenced this pull request Jan 25, 2022
The built-in geth client has a bugger implementation of HTTP/2: ethereum/go-ethereum#24292. Additionally, Go 1.17 has better HTTP/2 support than Go 1.15. This PR updates the BSS to use Go 1.17 in built binaries, and adds a flag to disable HTTP/2 support if necessary.
@fjl fjl merged commit abd49a6 into ethereum:master Jan 27, 2022
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Jan 28, 2022
When talking to an HTTP2 server, there are situations where it needs to
"rewind" the Request.Body. To allow this, we have to set up the Request.GetBody
function to return a brand new instance of the body.

If not set, we can end up with the following error:

    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

See this commit for more information: https://sourcegraph.com/github.com/golang/net/-/commit/cffdcf672aee934982473246bc7e9a8ba446aa9b?visible=2
JacekGlen pushed a commit to JacekGlen/go-ethereum that referenced this pull request May 26, 2022
When talking to an HTTP2 server, there are situations where it needs to
"rewind" the Request.Body. To allow this, we have to set up the Request.GetBody
function to return a brand new instance of the body.

If not set, we can end up with the following error:

    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

See this commit for more information: https://sourcegraph.com/github.com/golang/net/-/commit/cffdcf672aee934982473246bc7e9a8ba446aa9b?visible=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for HTTP2 GOAWAY in RPC client
2 participants