You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by nt...@apache.org on 2015/07/29 18:25:38 UTC

incubator-ignite git commit: IGNITE-1169 Fixed tests.

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-1169 325458125 -> 5c3d82973


IGNITE-1169 Fixed tests.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5c3d8297
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5c3d8297
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5c3d8297

Branch: refs/heads/ignite-1169
Commit: 5c3d82973cb80601540e6552c7b7b0b81c3f1fce
Parents: 3254581
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Jul 29 19:25:40 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Jul 29 19:25:40 2015 +0300

----------------------------------------------------------------------
 .../communication/tcp/TcpCommunicationSpi.java   | 19 +++++++++++++------
 ...ommunicationSpiRecoveryAckFutureSelfTest.java |  3 +--
 2 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5c3d8297/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 53c6ddf..18184f3 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -1749,11 +1749,16 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
     }
 
     /**
+     * Sends given message to destination node. Note that characteristics of the
+     * exchange such as durability, guaranteed delivery or error notification is
+     * dependant on SPI implementation.
      *
-     * @param node
-     * @param msg
-     * @return
-     * @throws IgniteSpiException
+     * @param destNode Destination node.
+     * @param msg Message to send.
+     * @return Future to be completed when ack will be received.
+     * @throws org.apache.ignite.spi.IgniteSpiException Thrown in case of any error during sending the message.
+     *      Note that this is not guaranteed that failed communication will result
+     *      in thrown exception as this is dependant on SPI implementation.
      */
     public IgniteInternalFuture<Boolean> sendMessageWithAck(ClusterNode node, Message msg) throws IgniteSpiException {
         assert node != null;
@@ -1764,8 +1769,10 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
 
         IgniteInternalFuture<Boolean> fut = null;
 
-        if (node.id().equals(getLocalNode().id())) {
-            notifyListener(node.id(), msg, NOOP);
+        UUID locNodeId = getLocalNodeId();
+
+        if (node.id().equals(locNodeId)) {
+            notifyListener(locNodeId, msg, NOOP);
 
             fut = new GridFinishedFuture<>(true);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5c3d8297/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckFutureSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckFutureSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckFutureSelfTest.java
index 2c2ef2e..56feda1 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckFutureSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckFutureSelfTest.java
@@ -170,8 +170,7 @@ public class GridTcpCommunicationSpiRecoveryAckFutureSelfTest<T extends Communic
                                 @Override public boolean apply() {
                                     return recoveryDesc.messagesFutures().isEmpty();
                                 }
-                            }, spi.failureDetectionTimeoutEnabled() ? spi.failureDetectionTimeout() + 7000 :
-                                10_000);
+                            }, 10_000);
 
                             assertEquals("Unexpected messages: " + recoveryDesc.messagesFutures(), 0,
                                 recoveryDesc.messagesFutures().size());