A worker exits, zk listens for an error(一个worker退出,zk监听报错)
Environment: 1 worker, 1 api, 1 master are all on the same machine. Problem: Every time the worker is shut down, an error is reported in the master's zk listener: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /escheduler/dead-servers/worker_xxxxxxxx See picture for details

环境:1个worker、1个api、1个master都在同一台机器上。 问题:每次关闭worker,在master的zk监听中都会报错:org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /escheduler/dead-servers/worker_xxxxxxxx 详情请见图片


I don't understand why exceptions are thrown. The code has already been judged.
which version do you use?
Probably because there is a concurrency issue and multiple master triggers will have problems
可能是因为存在并发问题,同时多个master触发就会有问题
This single mster and single worker test situation:
[INFO] 2019-07-06 02:27:43.330 cn.escheduler.server.zk.ZKMasterClient:[354] - node deleted : /escheduler/workers/172.17.0.2_0000000000 [INFO] 2019-07-06 02:27:43.334 cn.escheduler.common.zk.AbstractZKClient:[288] - worker server dead , and /escheduler/workers/172.17.0.2_0000000000 added to zk dead server path success [INFO] 2019-07-06 02:27:43.347 cn.escheduler.server.zk.ZKMasterClient:[372] - start worker failover ... [INFO] 2019-07-06 02:27:43.351 cn.escheduler.server.zk.ZKMasterClient:[388] - worker failover end [INFO] 2019-07-06 02:29:30.938 cn.escheduler.server.zk.ZKMasterClient:[349] - node added : /escheduler/workers/172.17.0.2_0000000001 [INFO] 2019-07-06 02:30:04.593 cn.escheduler.server.zk.ZKMasterClient:[354] - node deleted : /escheduler/workers/172.17.0.2_0000000001 [INFO] 2019-07-06 02:30:04.594 cn.escheduler.common.zk.AbstractZKClient:[288] - worker server dead , and /escheduler/workers/172.17.0.2_0000000001 added to zk dead server path success [INFO] 2019-07-06 02:30:04.600 cn.escheduler.server.zk.ZKMasterClient:[372] - start worker failover ... [INFO] 2019-07-06 02:30:04.601 cn.escheduler.server.zk.ZKMasterClient:[388] - worker failover end
The above is the test result of a single mster and a single worker, but did not find the situation that the brother said, I tested the situation of two masters, because the two masters listened to the worker at the same time, and then there is a concurrency situation, to determine where there is a concurrent judgment, So the above problem