Skip to content

Commit

Permalink
fix: Close Jetty h2 streams with RST_STREAM and no error code (#6401)
Browse files Browse the repository at this point in the history
This is a Jetty-specific workaround to avoid irritating the Python gRPC
client into failing calls that had already half-closed successfully.

See #6400
Fixes #5996
  • Loading branch information
niloc132 authored Nov 21, 2024
1 parent 5396c3a commit 6ada0cb
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,15 @@ public boolean isFinestEnabled() {
transportState.runOnTransportThread(
() -> {
transportState.complete();
asyncContext.complete();
// asyncContext.complete();
log.fine("call completed");
});
// Jetty specific fix: When AsyncContext.complete() is called, Jetty sends a RST_STREAM with
// "cancel" error to the client, while other containers send "no error" in this case. Calling
// close() instead on the output stream still sends the RST_STREAM, but with "no error". Note
// that this does the opposite in at least Tomcat, so we're not going to upstream this change.
// See https://github.com/deephaven/deephaven-core/issues/6400
outputStream.close();
};
this.isReady = () -> outputStream.isReady();
}
Expand Down

0 comments on commit 6ada0cb

Please sign in to comment.