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

grpc-js: Improve event sequencing when handling connection drops #2862

Conversation

murgatroid99
Copy link
Member

This changes a few things to try to report connection drops with the UNAVAILABLE status more consistently:

  • The transport now passes the connection drop event along to the call even if a GOAWAY has already been handled. This is important in the server-side graceful connection shutdown case, in which the server always first sends a GOAWAY and then drops the connection seconds later.
  • The transport now passes the connection drop event along immediately instead of waiting with a setImmediate, to ensure that the call sees the event as quickly as possible.
  • The call now delays handling the event with a setImmediate to mimic the old sequencing in most cases, but first flags that a connection drop event was seen. User reports indicate that Node (or nghttp2) probably synthesizes a RST_STREAM with the code CANCEL when a connection drops, so if the connection drop flag is set we treat that code as UNAVAILABLE instead of CANCELLED.

@murgatroid99 murgatroid99 merged commit e9359ef into grpc:@grpc/[email protected] Dec 4, 2024
4 of 5 checks passed
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.

1 participant