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

Improve Error Handling in Http2Transport for Graceful vs Abrupt Disconnections #2622

Closed
wants to merge 1 commit into from
Closed

Improve Error Handling in Http2Transport for Graceful vs Abrupt Disconnections #2622

wants to merge 1 commit into from

Conversation

w1am
Copy link

@w1am w1am commented Nov 27, 2023

This modification builds upon the changes made in #2563

Changed: Improved error handling in the Http2Transport class to differentiate between graceful and abrupt server disconnections. The handleDisconnect method has been updated to distinguish between a server's graceful shutdown, signaled by a GOAWAY frame, and abrupt terminations like socket errors.

The status of active calls is now set more appropriately - either to Cancelled or Unavailable. This addresses an inconsistency in a project, which previously led to confusion due to varying status codes from different server shutdown methods. It makes error handling clearer and more predictable.

- Distinguish between graceful and abrupt server disconnections.
- Set appropriate status codes (Cancelled for graceful, Unavailable for abrupt) for active calls.
Copy link

linux-foundation-easycla bot commented Nov 27, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: w1am / name: William Chong (05a7954)

@murgatroid99
Copy link
Member

A graceful shutdown is indicated by a GOAWAY with code 0. When that happens, open streams should continue until they end on their own. In some versions of Node, that doesn't happen due to nodejs/node#42713, which has only recently been fixed in Node 20.10.0.

GOAWAYs with other codes cause requests to fail, but not through this code path. Instead, Node itself signals a RST_STREAM to each open stream on that connection, and that is handled by this code path.

As a result, handleDisconnect should already only be handling abrupt disconnects that don't have a corresponding GOAWAY, so I don't think this change is necessary. If there is a particular case where you are seeing an unexpected error code, I suggest opening an issue.

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.

None yet

2 participants