From 7062be9bb7c9b36ad8c70fb114ac1fff4d4815a0 Mon Sep 17 00:00:00 2001 From: Andrew Zimmer Date: Tue, 28 May 2024 12:57:13 -0400 Subject: [PATCH] PEPPER-1413 delay the shutdown to give the db more time to clear connections ahead of starting up replacement instance. --- .../org/broadinstitute/ddp/appengine/spark/SparkBootUtil.java | 1 + 1 file changed, 1 insertion(+) diff --git a/pepper-apis/ddp-common/src/main/java/org/broadinstitute/ddp/appengine/spark/SparkBootUtil.java b/pepper-apis/ddp-common/src/main/java/org/broadinstitute/ddp/appengine/spark/SparkBootUtil.java index 624f8d1fe3..15fe3a802c 100644 --- a/pepper-apis/ddp-common/src/main/java/org/broadinstitute/ddp/appengine/spark/SparkBootUtil.java +++ b/pepper-apis/ddp-common/src/main/java/org/broadinstitute/ddp/appengine/spark/SparkBootUtil.java @@ -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);