CE-177 - when the HTTP2Stream is terminated from the remote server handle the close by cleaning up local state and firing an abort error. #639
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notes
Jira Ticket
We have implemented an Http2Adapter in the client which wraps up interaction with Node's underlying HTTP2 library: https://nodejs.org/api/http2.html
This code addresses a bug in the wrapper such that:
This fix addresses this issue by handling
close
events fired off by the remote server such that our adapter's internal state is appropriately updated.Note that we should only handle these events if two conditions are met:
error
event is not being fired (which we can detect via therstCode
) (see herestate.remoteClose
property. (see here)How to test
yarn test
and also we setup a Lambda to simulate the server remotely closing the connection by spinning up an AWS Lambda querying Fauna on a regular cadence. The Fauna cluster being queried is having its hosts constantly cycled such that we can reproduce the issue. With this change, the scenario now results in an error to the client, rather than a silent hang.I can provide a link to the integration test in question.