Browse Source

Fix the ephemeralId will not be deleted before jdbc-registry closed. (#14936)

dong6349 1 year ago
parent
commit
298b8ccf5a

+ 3 - 3
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/task/EphemeralDateManager.java

@@ -83,12 +83,12 @@ public class EphemeralDateManager implements AutoCloseable {
 
     @Override
     public void close() throws SQLException {
-        ephemeralDateIds.clear();
-        connectionListeners.clear();
-        scheduledExecutorService.shutdownNow();
         for (Long ephemeralDateId : ephemeralDateIds) {
             jdbcOperator.deleteDataById(ephemeralDateId);
         }
+        ephemeralDateIds.clear();
+        connectionListeners.clear();
+        scheduledExecutorService.shutdownNow();
     }
 
     // Use this task to refresh ephemeral term and check the connect state.