From 75ef1ddf1e351da43def07d1c70fd3a554568d48 Mon Sep 17 00:00:00 2001 From: "Robert (Bobby) Evans" Date: Mon, 4 Nov 2024 10:26:57 -0600 Subject: [PATCH] Make the zone DB shutdown/load cycle redoable Signed-off-by: Robert (Bobby) Evans --- .../nvidia/spark/rapids/jni/GpuTimeZoneDB.java | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/main/java/com/nvidia/spark/rapids/jni/GpuTimeZoneDB.java b/src/main/java/com/nvidia/spark/rapids/jni/GpuTimeZoneDB.java index 80314d3c7e..a8048b1e8b 100644 --- a/src/main/java/com/nvidia/spark/rapids/jni/GpuTimeZoneDB.java +++ b/src/main/java/com/nvidia/spark/rapids/jni/GpuTimeZoneDB.java @@ -57,23 +57,12 @@ public class GpuTimeZoneDB { // use this reference to indicate if time zone cache is initialized. private static HostColumnVector fixedTransitions; - private static boolean isShutdownCalledEver = false; - /** * This should be called on startup of an executor. * Runs in a thread asynchronously. * If `shutdown` was called ever, then will not load the cache */ public static void cacheDatabaseAsync() { - // This has a race in that we could still launch a thread after - // shutting down. This is just to prevent the thread from launching - // in some cases. - synchronized (GpuTimeZoneDB.class) { - if (isShutdownCalledEver) { - log.error("cache async called after DB already loaded"); - return; - } - } // start a new thread to load Runnable runnable = () -> { try { @@ -101,14 +90,10 @@ public static void cacheDatabase() { * close the cache, used when Plugin is closing */ public static synchronized void shutdown() { - isShutdownCalledEver = true; closeResources(); } private static synchronized void cacheDatabaseImpl() { - if (isShutdownCalledEver) { - throw new IllegalStateException("GpuTimeZoneDB has already been shut down"); - } if (fixedTransitions == null) { try { loadData();