Skip to content

Commit

Permalink
PEPPER-1413 delay the shutdown to give the db more time to clear conn…
Browse files Browse the repository at this point in the history
…ections ahead of starting up replacement instance.
  • Loading branch information
zyme committed May 28, 2024
1 parent 27eb101 commit 7062be9
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public static void startSparkServer(AppEngineShutdown stopRouteCallback, Config
// as a failure
if (numShutdownAttempts == 0) {
final ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
// temporary experiment to see if 5s gives the database enough time to free connections
executor.schedule(() -> stopRouteCallback.onAhStop(), 5, TimeUnit.SECONDS);
} else {
log.info("Ignoring shutdown attempt {}", numShutdownAttempts);
Expand Down

0 comments on commit 7062be9

Please sign in to comment.