From 4ba3a469181b17f9dcf3f8f39a2ae0df06b58e81 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Fri, 17 Jan 2025 15:13:00 +1100 Subject: [PATCH] Don't allow requests into restarting application If the app is restarting then we should not short-circuit the hot reload handler/scan lock logic. This is not perfect, as there will always be a possible race, but makes it much less likely a request will hit a torn down app. --- .../http/runtime/devmode/VertxHttpHotReplacementSetup.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/VertxHttpHotReplacementSetup.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/VertxHttpHotReplacementSetup.java index d717141311b0a..d2e2ca3d626af 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/VertxHttpHotReplacementSetup.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/VertxHttpHotReplacementSetup.java @@ -135,7 +135,9 @@ public Void call() { routingContext.request().resume(); return; } - if ((nextUpdate > System.currentTimeMillis() && !hotReplacementContext.isTest()) + if ((nextUpdate > System.currentTimeMillis() && + !hotReplacementContext.isTest() && + !DevConsoleManager.isDoingHttpInitiatedReload()) // if there is a live reload possibly going on we don't want to let a request through to restarting application, this is best effort, but it narrows the window a lot || routingContext.request().headers().contains(HEADER_NAME)) { if (hotReplacementContext.getDeploymentProblem() != null) { handleDeploymentProblem(routingContext, hotReplacementContext.getDeploymentProblem());