Skip to content

Commit

Permalink
Don't allow requests into restarting application
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stuartwdouglas committed Jan 17, 2025
1 parent 4b8edd9 commit 4d27759
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 4d27759

Please sign in to comment.