ruanwenjun commented on PR #13838:
URL: 
https://github.com/apache/dolphinscheduler/pull/13838#issuecomment-1491246163

   > > We don't need to add this check, this case might be due to we 
registering an empty node? Could you please describe how to reproduce this.
   > 
   > Yes, by default a `worker` node will be loaded in 
`registryClient.subscribe(REGISTRY_DOLPHINSCHEDULER_WORKERS, new 
WorkerDataListener()); `
   > 
   > ```java
   > registryClient.subscribe(REGISTRY_DOLPHINSCHEDULER_WORKERS, new 
WorkerDataListener()); 
   > String[] parts = path.split("/");  // REGISTRY_DOLPHINSCHEDULER_WORKERS = 
/nodes/worker
   > final String workerAddress = parts[parts.length - 1];  // workerAddress  = 
worker
   > if (type == Type.UPDATE) // the Type.UPDATE is  Node /nodes/worker update 
,   case NODE_UPDATED: type(Type.UPDATE);
   > syncSingleWorkerNodeInfo(workerAddress, JSONUtils.parseObject(data, 
WorkerHeartBeat.class));  //  ???
   > workerNodeInfo.put(workerAddress, info);  // put "worker" key into the 
workerNodeInfo
   > ```
   > 
   > The effect is that the `addr` of `getHostWeight` will be the `worker` and 
`heartBeat == null`.
   > 
   > so
   > 
   > ```java
   >         if (heartBeat == null) {
   >             logger.warn("worker {} in work group {} have not received the 
heartbeat", addr, workerGroup);
   >             return Optional.empty();
   >         }
   > ```
   
   So we only need to subscribe the child path of 
REGISTRY_DOLPHINSCHEDULER_WORKERS


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