-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Server abruptly terminates connections if write buffer is small enough #2089
Server abruptly terminates connections if write buffer is small enough #2089
Comments
Thanks for reporting. I'll take a look at it shortly. |
@MakMukhi hi, any chance this can be part of patch release? |
@euroelessar Sorry, just release 1.12.1 but missed this... There's also another release request (#2125), but I'm a bit unsure about the mentioned PR. If you don't mind, I will want for their reply and combine the releases. |
that works for me, thanks! |
@euroelessar Please see https://github.com/grpc/grpc-go/releases/tag/v1.12.2 for the release. |
full diff: grpc/grpc-go@v1.12.0...v1.12.2 - grpc/grpc-go#2074 transport/server: fix race between writing status and header - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit - grpc/grpc-go#2074 transport: account for user configured small io write buffer - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: grpc/grpc-go@v1.12.0...v1.12.2 - grpc/grpc-go#2074 transport/server: fix race between writing status and header - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit - grpc/grpc-go#2074 transport: account for user configured small io write buffer - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: grpc/grpc-go@v1.12.0...v1.12.2 - grpc/grpc-go#2074 transport/server: fix race between writing status and header - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit - grpc/grpc-go#2074 transport: account for user configured small io write buffer - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: grpc/grpc-go@v1.12.0...v1.12.2 - grpc/grpc-go#2074 transport/server: fix race between writing status and header - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit - grpc/grpc-go#2074 transport: account for user configured small io write buffer - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough Signed-off-by: Sebastiaan van Stijn <[email protected]> Upstream-commit: 6f572c8154c20253474a20decc87f677feb3321e Component: engine
full diff: grpc/grpc-go@v1.12.0...v1.12.2 - grpc/grpc-go#2074 transport/server: fix race between writing status and header - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit - grpc/grpc-go#2074 transport: account for user configured small io write buffer - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: grpc/grpc-go@v1.12.0...v1.12.2 - grpc/grpc-go#2074 transport/server: fix race between writing status and header - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit - grpc/grpc-go#2074 transport: account for user configured small io write buffer - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: grpc/grpc-go@v1.12.0...v1.12.2 - grpc/grpc-go#2074 transport/server: fix race between writing status and header - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit - grpc/grpc-go#2074 transport: account for user configured small io write buffer - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough Signed-off-by: Sebastiaan van Stijn <[email protected]> Upstream-commit: 25e6a64e2a1792cb5ae5a74741f5d6f2f4531cf8 Component: cli
full diff: grpc/grpc-go@v1.12.0...v1.12.2 - grpc/grpc-go#2074 transport/server: fix race between writing status and header - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit - grpc/grpc-go#2074 transport: account for user configured small io write buffer - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: grpc/grpc-go@v1.12.0...v1.12.2 - grpc/grpc-go#2074 transport/server: fix race between writing status and header - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit - grpc/grpc-go#2074 transport: account for user configured small io write buffer - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: grpc/grpc-go@v1.12.0...v1.12.2 - grpc/grpc-go#2074 transport/server: fix race between writing status and header - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit - grpc/grpc-go#2074 transport: account for user configured small io write buffer - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: grpc/grpc-go@v1.12.0...v1.12.2 - grpc/grpc-go#2074 transport/server: fix race between writing status and header - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit - grpc/grpc-go#2074 transport: account for user configured small io write buffer - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit 6f572c8) Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: grpc/grpc-go@v1.12.0...v1.12.2 - grpc/grpc-go#2074 transport/server: fix race between writing status and header - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit - grpc/grpc-go#2074 transport: account for user configured small io write buffer - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough Signed-off-by: Sebastiaan van Stijn <[email protected]>
Please answer these questions before submitting your issue.
What version of gRPC are you using?
grpc-1.12.0
What version of Go are you using (
go version
)?go version go1.8.4 linux/amd64
What operating system (Linux, Windows, …) and version?
Linux
What did you do?
Started a server with 8KB write buffer (using
grpc.WriteBufferSize
) in order to reduce per-connection memory usage by paying extra cpu cost.What did you expect to see?
Server successfully processes incoming connections and requests.
What did you see instead?
Server abruptly terminates incoming connection if http2 frame size happens to be greater than write buffer size.
It happens due to combination of following factors:
bufWriter
gives up if incoming data is greater than its buffer size and returns non-nil error:https://github.com/grpc/grpc-go/blob/master/transport/http_util.go#L530
Writer
interfaces and returnsio.ErrShortWrite
:https://github.com/golang/net/blob/master/http2/frame.go#L368
https://github.com/grpc/grpc-go/blob/master/transport/http2_server.go#L278
I would assume that this is also true for outgoing client connections due to shared code but didn't try to reproduce it.
The text was updated successfully, but these errors were encountered: