Skip to content

Commit

Permalink
fix issue leaf may break with special name Meituan-Dianping#188
Browse files Browse the repository at this point in the history
  • Loading branch information
qixiaobo committed Mar 21, 2022
1 parent 86a6441 commit f4e5df3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public boolean init() {
String newNode = createNode(curator);
zk_AddressNode = newNode;
String[] nodeKey = newNode.split("-");
workerID = Integer.parseInt(nodeKey[1]);
// fix issue https://github.com/Meituan-Dianping/Leaf/issues/188
workerID = Integer.parseInt(nodeKey[nodeKey.length - 1]);
doService(curator);
updateLocalWorkerID(workerID);
LOGGER.info("[New NODE]can not find node on forever node that endpoint ip-{} port-{} workid-{},create own node on forever node and start SUCCESS ", ip, port, workerID);
Expand Down

0 comments on commit f4e5df3

Please sign in to comment.