Browse Source

[Fix] In updateWorkerNodes method, the workerNodeInfoWriteLock should be used. #15898 (#15903)

Co-authored-by: answerliao <answerliao@tencent.com>
3.2.2-release-bak
DaqianLiao 6 months ago committed by GitHub
parent
commit
b29965bdce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java

4
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java

@ -245,7 +245,7 @@ public class ServerNodeManager implements InitializingBean {
}
private void updateWorkerNodes() {
workerGroupWriteLock.lock();
workerNodeInfoWriteLock.lock();
try {
Map<String, String> workerNodeMaps = registryClient.getServerMaps(RegistryNodeType.WORKER);
for (Map.Entry<String, String> entry : workerNodeMaps.entrySet()) {
@ -254,7 +254,7 @@ public class ServerNodeManager implements InitializingBean {
workerNodeInfo.put(nodeAddress, workerHeartBeat);
}
} finally {
workerGroupWriteLock.unlock();
workerNodeInfoWriteLock.unlock();
}
}

Loading…
Cancel
Save