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

Multiple GOAWAY frames on graceful shutdown leads to crash when Swift clients are connected #5786

Closed
karsten42 opened this issue Nov 10, 2022 · 3 comments · Fixed by #5854
Closed
Assignees

Comments

@karsten42
Copy link

What version of gRPC are you using?

google.golang.org/grpc v1.50.1

What version of Go are you using (go version)?

go 1.19

What operating system (Linux, Windows, …) and version?

Linux

What did you do?

NOTE: Copied from an issue for the swift client since we don't know what is the correct behaviour: grpc/grpc-swift#1520

We use a server implemented with grpc-go This server may gracefully shutdown the connection before shutting down itself. In the repository of grpc-go it is documented that the server sends two GOAWAY frames to circumvent a http2 race condition:

'''
// A client can receive multiple GoAways from the server (see
// #1387). The idea is that the first
// GoAway will be sent with an ID of MaxInt32 and the second GoAway will be
// sent after an RTT delay with the ID of the last stream the server will
// process.
'''

The grpc-swift-client responds to both GOAWAY frames with GOAWAY frames which leads the grpc-go-server to crash. E.g. the client implementation of grpc-go checks for already received GOAWAY frames and their stream ids which prevents two following GOAWAY frames by the client (Implementation).

Since the behavior of the grpc-swift-client causes other servers to crash we expect grpc-swift to change the behavior.

To reproduce
Steps to reproduce the bug you've found:

  1. Initiate connection
  2. Make a bidirectional RPC to the server (grpc-go)
  3. Invoke gracefullShutdown on the server
  4. Clients sends two GOAWAY frames
  5. Server crashes due to close of closed channel

We could reproduce the behaviour utilising the client from RouteGuide-Example and implementing a go-server using the example proto file.

What did you expect to see?

The server doesn't crash.

What did you see instead?

The server crashes due to closing a channel twice.

@zasweq
Copy link
Contributor

zasweq commented Nov 17, 2022

Working on reproducing this now. Do you happen to have a stack trace of the crash?

@karsten42
Copy link
Author

Yes, it's exactly the stack trace you find in the Swift issue.

@dfawley
Copy link
Member

dfawley commented Dec 20, 2022

Our side fixed by #5854

@dfawley dfawley closed this as completed Dec 20, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants