未验证 提交 68bc5976 编写于 作者: B bao liang 提交者: GitHub

fix bug: send task result to master until success. (#2839)

* fix bug: send task result to master until success.

* fix bug: send task result to master until success.

* add sleep

* set null if send result failed

* set null if send result failed
Co-authored-by: Nbaoliang <baoliang@analysys.com.cn>
上级 12dc18bb
......@@ -102,20 +102,23 @@ public class TaskCallbackService {
while (Stopper.isRunning()) {
masterNodes = zookeeperRegistryCenter.getMasterNodesDirectly();
if (CollectionUtils.isEmpty(masterNodes)) {
masterNodes = null;
ThreadUtils.sleep(SLEEP_TIME_MILLIS);
}else {
logger.error("find {} masters for task : {}.",
masterNodes.size(),
taskInstanceId);
break;
continue;
}
}
for(String masterNode : masterNodes){
newChannel = nettyRemotingClient.getChannel(Host.of(masterNode));
if(newChannel != null){
return getRemoteChannel(newChannel, nettyRemoteChannel.getOpaque(), taskInstanceId);
logger.info("find {} masters for task : {}.",
masterNodes.size(),
taskInstanceId);
for (String masterNode : masterNodes) {
newChannel = nettyRemotingClient.getChannel(Host.of(masterNode));
if (newChannel != null) {
return getRemoteChannel(newChannel, nettyRemoteChannel.getOpaque(), taskInstanceId);
}
}
masterNodes = null;
ThreadUtils.sleep(SLEEP_TIME_MILLIS);
}
throw new IllegalStateException(String.format("all available master nodes : %s are not reachable for task: {}", masterNodes, taskInstanceId));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册