Skip to content

Commit 4ba3a46

Browse files
stuartwdouglasgeoand
authored andcommitted
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.
1 parent aec3f34 commit 4ba3a46

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/VertxHttpHotReplacementSetup.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ public Void call() {
135135
routingContext.request().resume();
136136
return;
137137
}
138-
if ((nextUpdate > System.currentTimeMillis() && !hotReplacementContext.isTest())
138+
if ((nextUpdate > System.currentTimeMillis() &&
139+
!hotReplacementContext.isTest() &&
140+
!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
139141
|| routingContext.request().headers().contains(HEADER_NAME)) {
140142
if (hotReplacementContext.getDeploymentProblem() != null) {
141143
handleDeploymentProblem(routingContext, hotReplacementContext.getDeploymentProblem());

0 commit comments

Comments
 (0)