From 2105c297970dce19d7723a72b14646d7f5c574b7 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Thu, 22 Jul 2021 08:03:29 +1000 Subject: [PATCH] Add connection: close if the server is shut down Fixes #18890 --- .../vertx/http/runtime/filters/GracefulShutdownFilter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/filters/GracefulShutdownFilter.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/filters/GracefulShutdownFilter.java index de9cee1719610..f93add219fc3d 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/filters/GracefulShutdownFilter.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/filters/GracefulShutdownFilter.java @@ -5,6 +5,7 @@ import org.jboss.logging.Logger; +import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpResponseStatus; import io.quarkus.runtime.shutdown.ShutdownListener; import io.vertx.core.Handler; @@ -40,7 +41,8 @@ public void handle(Void event) { @Override public void handle(HttpServerRequest event) { if (!running) { - event.response().setStatusCode(HttpResponseStatus.SERVICE_UNAVAILABLE.code()).end(); + event.response().setStatusCode(HttpResponseStatus.SERVICE_UNAVAILABLE.code()) + .putHeader(HttpHeaderNames.CONNECTION, "close").end(); return; } currentRequestCount.incrementAndGet();