Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 17, 2023

Conversation

niloc132
Copy link
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
@@ -439,6 +463,8 @@ private void tryClose() {
*/
private class SnapshotRequestHandler
implements Handler {
private final AtomicReference<HalfClosedState> halfClosedState =
Copy link
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
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
10 checks passed
@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