Skip to content

Commit

Permalink
fix keep-alive connections
Browse files Browse the repository at this point in the history
Signed-off-by: tmanninger <t.manninger@ixolit.com>
  • Loading branch information
tmanninger committed Sep 27, 2024
1 parent d308955 commit 65df2af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ protected void doStop() {
}
try {
TimeUnit.MILLISECONDS.sleep(30);
TimeUnit.MILLISECONDS.sleep(30);
} catch (InterruptedException ie) {
throw new OpenSearchException("Interrupted waiting for completion of [{}]", ie);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ public void sendResponse(RestResponse restResponse) {
setHeaderField(httpResponse, X_OPAQUE_ID, opaque);
}

if (settings.forceCloseConnection()) {
// Server is in shutdown mode. Send client to close the connection.
// -------------
// Only works with http1
// How to check request httpversion is 2 AND send goaway signal?
setHeaderField(httpResponse, CONNECTION, CLOSE);
}

// Add all custom headers
addCustomHeaders(httpResponse, restResponse.getHeaders());
addCustomHeaders(httpResponse, threadContext.getResponseHeaders());
Expand Down

0 comments on commit 65df2af

Please sign in to comment.