github-code-scanning[bot] commented on code in PR #14887:
URL: 
https://github.com/apache/dolphinscheduler/pull/14887#discussion_r1320762321


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java:
##########
@@ -210,40 +213,59 @@
         public void notify(Event event) {
             final String path = event.path();
             final Type type = event.type();
+            final String data = event.data();
             if (registryClient.isMasterPath(path)) {
                 try {
+                    String[] parts = path.split("/");
+                    final String masterAddress = parts[parts.length - 1];
                     if (type.equals(Type.ADD)) {
                         log.info("master node : {} added.", path);
                         updateMasterNodes();
-                    }
-                    if (type.equals(Type.REMOVE)) {
+                    } else if (type.equals(Type.REMOVE)) {
                         log.info("master node : {} down.", path);
                         updateMasterNodes();
                         alertDao.sendServerStoppedAlert(1, path, "MASTER");
+                    } else if (type == Type.UPDATE) {
+                        MasterHeartBeat info = JSONUtils.parseObject(data, 
MasterHeartBeat.class);
+                        if (updateSlots(info.isOverload(), masterAddress)) {
+                            log.info("master node : {} become overload.");

Review Comment:
   ## Missing format argument
   
   This format call refers to 1 argument(s) but only supplies 0 argument(s).
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/3478)



-- 
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