Repository navigation
DoExchange snapshot won't half-close until after client does - #4653
Merged
niloc132 merged 2 commits intoOct 17, 2023
Merged
Conversation
Additional mitigation for envoyproxy/envoy#30149 - combined with a client that will always half-close before the server does, this ensures that the server will never need to half-close first in order to end a stream. This is technically a breaking change - existing clients which fail to half-close will instead hang with the connection left open until timeout. Fixes deephaven#4627
rcaudy
reviewed
Oct 17, 2023
| */ | ||
| private class SnapshotRequestHandler | ||
| implements Handler { | ||
| private final AtomicReference<HalfClosedState> halfClosedState = |
Member
There was a problem hiding this comment.
If we didn't think all of the documentation and validation we have were valuable, we cold replace this with anything that lets us atomically count to 2, right?
Member
Author
There was a problem hiding this comment.
Yes - and I'm good with that, I just tend toward readability for the next poor soul who has to deal with this. AtomicInt would be great, just increment and if it equals 2, we close. The "4th" state of "we already closed" is almost certainly impossible, I just like a complete state machine if I'm going that route.
With all of that said, if we're happy about correctness/readability, I'm happy to rewrite in a more concise way.
rcaudy
approved these changes
Oct 17, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Additional mitigation for envoyproxy/envoy#30149 - combined with a client that will always half-close before the server does, this ensures that the server will never need to half-close first in order to end a stream. This is technically a breaking change - existing clients which fail to half-close will instead hang with the connection left open until timeout.
Fixes #4627