This repository has been archived by the owner on Feb 18, 2021. It is now read-only.
Outputhost replica stream: write-pump error should not close read-pump #190
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.
When the store reaches the end of the extent, it closes the stream and the underlying connection -- the outputhost is expected to drain out the connection before closing out. Unfortunately, in that time, if the outputhost write-credits-pump attempts to write out credits, it would fail since the connection is closed -- and in response to that, it triggers a stoppage of the read-pump, as well, before it drains out messages in the stream. This would cause outputhost to connect to a new replica to re-read the "tail" of the messages.
This change fixes that behaviour -- so a write-pump failure does not cause the read-pump to close. The read-pump would close when it has drained out the connection and it encounters a network error.