Skip to content

DoExchange snapshot won't half-close until after client does - #4653

Merged
niloc132 merged 2 commits into
deephaven:mainfrom
niloc132:4627-breaking-changes-mitigation
Oct 17, 2023
Merged

niloc132 merged 2 commits into
deephaven:mainfrom
niloc132:4627-breaking-changes-mitigation

Conversation

@niloc132

Copy link
Copy Markdown
Member

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

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
*/
private class SnapshotRequestHandler
implements Handler {
private final AtomicReference<HalfClosedState> halfClosedState =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@niloc132
niloc132 merged commit 186891c into deephaven:main Oct 17, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

io.grpc.StatusRuntimeException: UNAVAILABLE: RST_STREAM closed stream. HTTP/2 error code: NO_ERROR

2 participants