fix: handle server-sent termination in RPC #432
Merged
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.
Issue #, if available:
Description of changes:
Eventstream server can send a response with the terminate stream flag set, if this flag is set then the client must not send any more messages to that stream. This is sometimes failing on Windows specifically when the client tries to close the operation after the server has already closed it, which results in a protocol error and the client getting disconnected. This change will set the internal state of the operation to be "ended" which means that when the operation is later closed, it will not send the client-side termination message which would result in the protocol error.
Verifying by running our internal test suite on Windows which originally had this issue in a loop. Passed 10 times in a row using this change. Also ran on linux the same tests 5 times which also passed.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.