Skip to content

Commit 593147e

Browse files
committed
Make busy master/worker can registered
1 parent ce7440d commit 593147e

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,6 @@ void registry() {
9494
log.info("Master node : {} registering to registry center", masterConfig.getMasterAddress());
9595
String masterRegistryPath = masterConfig.getMasterRegistryPath();
9696

97-
MasterHeartBeat heartBeat = masterHeartBeatTask.getHeartBeat();
98-
while (ServerStatus.BUSY.equals(heartBeat.getServerStatus())) {
99-
log.warn("Master node is BUSY: {}", heartBeat);
100-
heartBeat = masterHeartBeatTask.getHeartBeat();
101-
ThreadUtils.sleep(SLEEP_TIME_MILLIS);
102-
}
103-
10497
// remove before persist
10598
registryClient.remove(masterRegistryPath);
10699
registryClient.persistEphemeral(masterRegistryPath, JSONUtils.toJsonString(masterHeartBeatTask.getHeartBeat()));
@@ -110,9 +103,6 @@ void registry() {
110103
ThreadUtils.sleep(SLEEP_TIME_MILLIS);
111104
}
112105

113-
// sleep 1s, waiting master failover remove
114-
ThreadUtils.sleep(SLEEP_TIME_MILLIS);
115-
116106
masterHeartBeatTask.start();
117107
log.info("Master node : {} registered to registry center successfully", masterConfig.getMasterAddress());
118108

dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistryClient.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,27 +84,18 @@ public void start() {
8484
}
8585
}
8686

87-
private void registry() throws InterruptedException {
88-
WorkerHeartBeat workerHeartBeat = workerHeartBeatTask.getHeartBeat();
89-
while (ServerStatus.BUSY.equals(workerHeartBeat.getServerStatus())) {
90-
log.warn("Worker node is BUSY: {}", workerHeartBeat);
91-
workerHeartBeat = workerHeartBeatTask.getHeartBeat();
92-
Thread.sleep(SLEEP_TIME_MILLIS);
93-
}
87+
private void registry() {
9488
String workerRegistryPath = workerConfig.getWorkerRegistryPath();
9589
// remove before persist
9690
registryClient.remove(workerRegistryPath);
97-
registryClient.persistEphemeral(workerRegistryPath, JSONUtils.toJsonString(workerHeartBeat));
91+
registryClient.persistEphemeral(workerRegistryPath, JSONUtils.toJsonString(workerHeartBeatTask.getHeartBeat()));
9892
log.info("Worker node: {} registry to registry center {} successfully", workerConfig.getWorkerAddress(),
9993
workerRegistryPath);
10094

10195
while (!registryClient.checkNodeExists(workerConfig.getWorkerAddress(), RegistryNodeType.WORKER)) {
10296
ThreadUtils.sleep(SLEEP_TIME_MILLIS);
10397
}
10498

105-
// sleep 1s, waiting master failover remove
106-
ThreadUtils.sleep(Constants.SLEEP_TIME_MILLIS);
107-
10899
workerHeartBeatTask.start();
109100
log.info("Worker node: {} registry finished", workerConfig.getWorkerAddress());
110101
}

0 commit comments

Comments
 (0)