github-advanced-security[bot] commented on code in PR #16821:
URL: 
https://github.com/apache/dolphinscheduler/pull/16821#discussion_r1849661538


##########
dolphinscheduler-registry/dolphinscheduler-registry-api/src/main/java/org/apache/dolphinscheduler/registry/api/RegistryClient.java:
##########
@@ -222,4 +232,22 @@
     private Collection<String> getServerNodes(RegistryNodeType nodeType) {
         return getChildrenKeys(nodeType.getRegistryPath());
     }
+
+    private void cleanHistoryFailoverFinishedNodes() {
+        // Clean the history failover finished nodes
+        // which failover is before the current time minus 1 week
+        final Collection<String> failoverFinishedNodes =
+                
registry.children(RegistryNodeType.FAILOVER_FINISH_NODES.getRegistryPath());
+        if (CollectionUtils.isEmpty(failoverFinishedNodes)) {
+            return;
+        }
+        for (final String failoverFinishedNode : failoverFinishedNodes) {
+            final String failoverFinishTime = 
registry.get(failoverFinishedNode);
+            if (System.currentTimeMillis() - 
Long.parseLong(failoverFinishTime) > TimeUnit.DAYS.toMillis(7)) {

Review Comment:
   ## Missing catch of NumberFormatException
   
   Potential uncaught 'java.lang.NumberFormatException'.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/5103)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to