ascherbakoff commented on a change in pull request #3501: ignite-7648
URL: https://github.com/apache/ignite/pull/3501#discussion_r254295036
##########
File path:
modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
##########
@@ -3351,19 +3386,45 @@ protected GridCommunicationClient
createTcpClient(ClusterNode node, int connIdx)
rcvCnt = safeTcpHandshake(ch,
recoveryDesc,
node.id(),
- timeoutHelper.nextTimeoutChunk(connTimeout0),
+ connTimeoutStgy.currentTimeout(),
sslMeta,
handshakeConnIdx);
if (rcvCnt == ALREADY_CONNECTED)
return null;
else if (rcvCnt == NODE_STOPPING)
throw new ClusterTopologyCheckedException("Remote
node started stop procedure: " + node.id());
+ else if (rcvCnt == UNKNOWN_NODE)
+ throw new ClusterTopologyCheckedException("Remote
node doesn't observe current node in topology : " + node.id());
else if (rcvCnt == NEED_WAIT) {
- needWait = true;
+ long outOfTopDelay =
outOfTopTimeoutStgy.getAndCalculateNextTimeout();
+
+ //check that failure timeout will be reached after
sleep(outOfTopDelay).
+ if
(outOfTopTimeoutStgy.checkTimeout(outOfTopDelay)) {
+ U.warn(log, "Handshake NEED_WAIT timed out
(will stop attempts to perform the handshake) " +
+ "[node=" + node.id() +
+ ", outOfTopTimeoutStgy=" +
outOfTopTimeoutStgy +
+ ", addr=" + addr +
+ ", failureDetectionTimeoutEnabled" +
failureDetectionTimeoutEnabled() +
+ ", totalTimeout" + totalTimeout + ']');
+
+ throw new
ClusterTopologyCheckedException("Failed to connect to node " +
+ "(current or target node is out of
topology on target node within timeout). " +
+ "Make sure that each ComputeTask and
cache Transaction has a timeout set " +
+ "in order to prevent parties from
waiting forever in case of network issues " +
+ "[nodeId=" + node.id() + ", addrs=" +
addrs + ']');
+ }
+ else {
+ if (log.isDebugEnabled())
+ log.debug("NEED_WAIT received, handshake
after delay [node = "
+ + node + ", outOfTopologyDelay = " +
outOfTopDelay + "ms]");
- continue;
- }
+ U.sleep(outOfTopDelay);
Review comment:
Please remove long sleep
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services