ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/3] ignite git commit: ignite-4799 TcpDiscoverySpi: removed missedHeartbeats properties, heartbeatFrequency (instead use IgiteConfiguration.metricsUpdateFrequency). Added IgiteConfiguration.clientFailureDetectionTimeout.
Date Wed, 26 Apr 2017 12:45:08 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-2.0 c829aacaf -> 6998785a8


http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
index 524fdcf..4b61199 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
@@ -73,7 +73,6 @@ import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddedMessage
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.jetbrains.annotations.Nullable;
-
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static java.util.concurrent.TimeUnit.MINUTES;
 import static org.apache.ignite.events.EventType.EVT_CLIENT_NODE_DISCONNECTED;
@@ -142,7 +141,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
     private boolean longSockTimeouts;
 
     /** */
-    private int maxMissedClientHbs = TcpDiscoverySpi.DFLT_MAX_MISSED_CLIENT_HEARTBEATS;
+    private long clientFailureDetectionTimeout = 1000;
 
     /** */
     private IgniteInClosure2X<TcpDiscoveryAbstractMessage, Socket> afterWrite;
@@ -154,9 +153,9 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws
Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
 
-        TcpDiscoverySpi disco = getDiscoverySpi();
+        cfg.setClientFailureDetectionTimeout(clientFailureDetectionTimeout());
 
-        disco.setMaxMissedClientHeartbeats(maxMissedClientHbs);
+        TcpDiscoverySpi disco = getDiscoverySpi();
 
         if (igniteInstanceName.startsWith("server"))
             disco.setIpFinder(IP_FINDER);
@@ -269,12 +268,21 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
     }
 
     /**
+     * Gets client failure detection timeout to use.
+     *
+     * @return Client failure detection timeout.
+     */
+    protected long clientFailureDetectionTimeout() {
+        return clientFailureDetectionTimeout;
+    }
+
+    /**
      * Gets failure detection timeout to use.
      *
      * @return Failure detection timeout.
      */
     protected long failureDetectionTimeout() {
-        return 0;
+        return 500;
     }
 
     /**
@@ -301,6 +309,21 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
     /**
      * @throws Exception If failed.
      */
+    public void testClientToClientPing() throws Exception {
+        startGrid("server-p1");
+        Ignite c1 = startGrid("client-p1");
+
+        startGrid("server-p2");
+        Ignite c2 = startGrid("client-p2");
+
+        boolean res = ((IgniteEx)c1).context().discovery().pingNode(c2.cluster().localNode().id());
+
+        assertTrue(res);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testClientNodeJoin() throws Exception {
         startServerNodes(3);
         startClientNodes(3);
@@ -358,8 +381,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
 
         failClient(2);
 
-        await(srvFailedLatch);
-        await(clientFailedLatch);
+        awaitClient(srvFailedLatch);
+        awaitClient(clientFailedLatch);
 
         checkNodes(3, 2);
     }
@@ -588,7 +611,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
      * @throws Exception If failed.
      */
     public void testClientReconnectTopologyChange1() throws Exception {
-        maxMissedClientHbs = 100;
+        clientFailureDetectionTimeout = 100000;
 
         clientsPerSrv = 1;
 
@@ -632,7 +655,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
      * @throws Exception If failed.
      */
     public void testClientReconnectTopologyChange2() throws Exception {
-        maxMissedClientHbs = 100;
+        clientFailureDetectionTimeout = 100000;
 
         clientsPerSrv = 1;
 
@@ -744,8 +767,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
 
             failServer(2);
 
-            await(srvFailedLatch);
-            await(clientFailedLatch);
+            awaitClient(srvFailedLatch);
+            awaitClient(clientFailedLatch);
 
             await(client2StoppedLatch);
 
@@ -796,6 +819,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
     }
 
     /**
+     * Test that server not fire client failure event after failure detection timeout.
+     *
      * @throws Exception If failed.
      */
     public void testClientNodeFailOneServer() throws Exception {
@@ -843,8 +868,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
         failClient(1);
         failServer(1);
 
-        await(srvFailedLatch);
-        await(clientFailedLatch);
+        awaitClient(srvFailedLatch);
+        awaitClient(clientFailedLatch);
 
         checkNodes(1, 1);
     }
@@ -1631,7 +1656,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
         assertFalse(err.get());
 
         if (!failSrv) {
-            await(srvFailedLatch);
+            awaitClient(srvFailedLatch);
 
             GridTestUtils.waitForCondition(new GridAbsPredicate() {
                 @Override public boolean apply() {
@@ -1721,7 +1746,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
     public void testDisconnectAfterNetworkTimeout() throws Exception {
         netTimeout = 5000;
         joinTimeout = 60_000;
-        maxMissedClientHbs = 2;
+        clientFailureDetectionTimeout = 2000;
 
         startServerNodes(1);
 
@@ -1774,7 +1799,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
 
         clientSpi.brakeConnection();
 
-        assertTrue(disconnectLatch.await(awaitTime(), MILLISECONDS));
+        assertTrue(disconnectLatch.await(awaitClientTime(), MILLISECONDS));
 
         log.info("Fail client connection2.");
 
@@ -1793,7 +1818,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
             @Override public boolean apply() {
                 return srv.cluster().nodes().size() == 2;
             }
-        }, awaitTime());
+        }, awaitClientTime());
 
         checkNodes(1, 1);
 
@@ -2076,6 +2101,15 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
     }
 
     /**
+     * @param latch Latch.
+     * @throws InterruptedException If interrupted.
+     */
+    private void awaitClient(CountDownLatch latch) throws InterruptedException {
+        assertTrue("Failed to wait for latch, latch count: " + latch.getCount(),
+            latch.await(awaitClientTime(), MILLISECONDS));
+    }
+
+    /**
      * Time to wait for operation completion.
      *
      * @return Time in milliseconds.
@@ -2085,6 +2119,15 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
     }
 
     /**
+     * Time to wait for client operation completion.
+     *
+     * @return Time in milliseconds.
+     */
+    protected long awaitClientTime() {
+        return 20_000;
+    }
+
+    /**
      */
     private static class MessageListener implements IgniteBiPredicate<UUID, Object>
{
         /** */
@@ -2267,7 +2310,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
             IgniteSpiOperationTimeoutHelper timeoutHelper) throws IOException, IgniteSpiOperationTimeoutException
{
             waitFor(openSockLock);
 
-            return super.openSocket(sockAddr, new IgniteSpiOperationTimeoutHelper(this));
+            return super.openSocket(sockAddr, timeoutHelper);
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
index c6d1147..f8f9baf 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
@@ -78,7 +78,7 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMultic
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryAbstractMessage;
 import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryCustomEventMessage;
-import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryHeartbeatMessage;
+import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryMetricsUpdateMessage;
 import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddFinishedMessage;
 import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddedMessage;
 import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFailedMessage;
@@ -154,16 +154,14 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
 
         spi.setNetworkTimeout(2500);
 
-        spi.setHeartbeatFrequency(1000);
-
-        spi.setMaxMissedHeartbeats(3);
-
         spi.setIpFinderCleanFrequency(5000);
 
         spi.setJoinTimeout(5000);
 
         cfg.setDiscoverySpi(spi);
 
+        cfg.setFailureDetectionTimeout(7500);
+
         if (ccfgs != null)
             cfg.setCacheConfiguration(ccfgs);
         else
@@ -173,12 +171,16 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
 
         cfg.setIncludeProperties();
 
+        cfg.setMetricsUpdateFrequency(1000);
+
         if (!igniteInstanceName.contains("LoopbackProblemTest"))
             cfg.setLocalHost("127.0.0.1");
 
         if (igniteInstanceName.contains("testFailureDetectionOnNodePing")) {
             spi.setReconnectCount(1); // To make test faster: on Windows 1 connect takes
1 second.
-            spi.setHeartbeatFrequency(40000);
+
+            cfg.setMetricsUpdateFrequency(40000);
+            cfg.setClientFailureDetectionTimeout(41000);
         }
 
         cfg.setConnectorConfiguration(null);
@@ -433,7 +435,7 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
 
         assertFalse("Ping is ok for node " + failedNodeId + ", but had to fail.", res);
 
-        // Heartbeat interval is 40 seconds, but we should detect node failure faster.
+        // Metrics update interval is 40 seconds, but we should detect node failure faster.
         assert cnt.await(7, SECONDS);
     }
 
@@ -2252,7 +2254,7 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
             long timeout) throws IOException, IgniteCheckedException {
             boolean add = msgIds.add(msg.id());
 
-            if (checkDuplicates && !add && !(msg instanceof TcpDiscoveryHeartbeatMessage))
{
+            if (checkDuplicates && !add && !(msg instanceof TcpDiscoveryMetricsUpdateMessage))
{
                 log.error("Send duplicated message: " + msg);
 
                 failed = true;

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiConfigSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiConfigSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiConfigSelfTest.java
index c349e5f..ea1bb27 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiConfigSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiConfigSelfTest.java
@@ -40,9 +40,7 @@ public class TcpDiscoverySpiConfigSelfTest extends GridSpiAbstractConfigTest<Tcp
         checkNegativeSpiProperty(new TcpDiscoverySpi(), "ackTimeout", 0);
         checkNegativeSpiProperty(new TcpDiscoverySpi(), "maxAckTimeout", 0);
         checkNegativeSpiProperty(new TcpDiscoverySpi(), "reconnectCount", 0);
-        checkNegativeSpiProperty(new TcpDiscoverySpi(), "heartbeatFrequency", 0);
         checkNegativeSpiProperty(new TcpDiscoverySpi(), "threadPriority", -1);
-        checkNegativeSpiProperty(new TcpDiscoverySpi(), "maxMissedHeartbeats", 0);
         checkNegativeSpiProperty(new TcpDiscoverySpi(), "statisticsPrintFrequency", 0);
     }
 
@@ -65,4 +63,4 @@ public class TcpDiscoverySpiConfigSelfTest extends GridSpiAbstractConfigTest<Tcp
             stopAllGrids();
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureTimeoutSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureTimeoutSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureTimeoutSelfTest.java
index a218bcb..cb5e84b 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureTimeoutSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureTimeoutSelfTest.java
@@ -24,7 +24,6 @@ import java.net.Socket;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.lang.IgniteProductVersion;
 import org.apache.ignite.spi.IgniteSpiOperationTimeoutException;
 import org.apache.ignite.spi.IgniteSpiOperationTimeoutHelper;
 import org.apache.ignite.spi.discovery.AbstractDiscoverySelfTest;
@@ -93,6 +92,11 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
                 firstSpi().failureDetectionTimeout());
         assertEquals(IgniteConfiguration.DFLT_FAILURE_DETECTION_TIMEOUT.longValue(),
                 secondSpi().failureDetectionTimeout());
+
+        assertEquals(IgniteConfiguration.DFLT_CLIENT_FAILURE_DETECTION_TIMEOUT.longValue(),
+            firstSpi().clientFailureDetectionTimeout());
+        assertEquals(IgniteConfiguration.DFLT_CLIENT_FAILURE_DETECTION_TIMEOUT.longValue(),
+            secondSpi().clientFailureDetectionTimeout());
     }
 
     /**
@@ -102,6 +106,7 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
         for (int i = 2; i < spis.size(); i++) {
             assertFalse(((TcpDiscoverySpi)spis.get(i)).failureDetectionTimeoutEnabled());
             assertEquals(0, ((TcpDiscoverySpi)spis.get(i)).failureDetectionTimeout());
+            assertFalse(0 == ((TcpDiscoverySpi)spis.get(i)).clientFailureDetectionTimeout());
         }
     }
 
@@ -112,14 +117,14 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
         try {
             ClusterNode node = secondSpi().getLocalNode();
 
-            firstSpi().openSocketTimeout = true;
+            firstSpi().openSockTimeout = true;
 
             assertFalse(firstSpi().pingNode(node.id()));
             assertTrue(firstSpi().validTimeout);
             assertTrue(firstSpi().err.getMessage().equals("Timeout: openSocketTimeout"));
 
-            firstSpi().openSocketTimeout = false;
-            firstSpi().openSocketTimeoutWait = true;
+            firstSpi().openSockTimeout = false;
+            firstSpi().openSockTimeoutWait = true;
 
             assertFalse(firstSpi().pingNode(node.id()));
             assertTrue(firstSpi().validTimeout);
@@ -138,12 +143,12 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
         try {
             ClusterNode node = secondSpi().getLocalNode();
 
-            firstSpi().writeToSocketTimeoutWait = true;
+            firstSpi().writeToSockTimeoutWait = true;
 
             assertFalse(firstSpi().pingNode(node.id()));
             assertTrue(firstSpi().validTimeout);
 
-            firstSpi().writeToSocketTimeoutWait = false;
+            firstSpi().writeToSockTimeoutWait = false;
 
             assertTrue(firstSpi().pingNode(node.id()));
             assertTrue(firstSpi().validTimeout);
@@ -178,13 +183,13 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
 
             assert nextSpi.connCheckStatusMsgCntReceived == 0;
 
-            firstSpi().countConnCheckMsg = true;
-            nextSpi.countConnCheckMsg = true;
+            firstSpi().cntConnCheckMsg = true;
+            nextSpi.cntConnCheckMsg = true;
 
             Thread.sleep(firstSpi().failureDetectionTimeout());
 
-            firstSpi().countConnCheckMsg = false;
-            nextSpi.countConnCheckMsg = false;
+            firstSpi().cntConnCheckMsg = false;
+            nextSpi.cntConnCheckMsg = false;
 
             int sent = firstSpi().connCheckStatusMsgCntSent;
             int received = nextSpi.connCheckStatusMsgCntReceived;
@@ -224,16 +229,16 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
      */
     private static class TestTcpDiscoverySpi extends TcpDiscoverySpi {
         /** */
-        private volatile boolean openSocketTimeout;
+        private volatile boolean openSockTimeout;
 
         /** */
-        private volatile boolean openSocketTimeoutWait;
+        private volatile boolean openSockTimeoutWait;
 
         /** */
-        private volatile boolean writeToSocketTimeoutWait;
+        private volatile boolean writeToSockTimeoutWait;
 
         /** */
-        private volatile boolean countConnCheckMsg;
+        private volatile boolean cntConnCheckMsg;
 
         /** */
         private volatile int connCheckStatusMsgCntSent;
@@ -253,11 +258,11 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
             IgniteSpiOperationTimeoutHelper timeoutHelper)
             throws IOException, IgniteSpiOperationTimeoutException {
 
-            if (openSocketTimeout) {
+            if (openSockTimeout) {
                 err = new IgniteSpiOperationTimeoutException("Timeout: openSocketTimeout");
                 throw err;
             }
-            else if (openSocketTimeoutWait) {
+            else if (openSockTimeoutWait) {
                 long timeout = timeoutHelper.nextTimeoutChunk(0);
 
                 try {
@@ -291,7 +296,7 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
         @Override protected void writeToSocket(Socket sock, OutputStream out, TcpDiscoveryAbstractMessage
msg, long timeout)
             throws IOException, IgniteCheckedException {
             if (!(msg instanceof TcpDiscoveryPingRequest)) {
-                if (countConnCheckMsg && msg instanceof TcpDiscoveryConnectionCheckMessage)
+                if (cntConnCheckMsg && msg instanceof TcpDiscoveryConnectionCheckMessage)
                     connCheckStatusMsgCntSent++;
 
                 super.writeToSocket(sock, out, msg, timeout);
@@ -305,7 +310,7 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
                 throw new IgniteCheckedException("Invalid timeout: " + timeout);
             }
 
-            if (writeToSocketTimeoutWait) {
+            if (writeToSockTimeoutWait) {
                 try {
                     Thread.sleep(timeout);
                 }
@@ -320,7 +325,7 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
         /** {@inheritDoc} */
         protected void writeToSocket(TcpDiscoveryAbstractMessage msg, Socket sock, int res,
long timeout)
             throws IOException {
-            if (countConnCheckMsg && msg instanceof TcpDiscoveryConnectionCheckMessage)
+            if (cntConnCheckMsg && msg instanceof TcpDiscoveryConnectionCheckMessage)
                 connCheckStatusMsgCntReceived++;
 
             super.writeToSocket(msg, sock, res, timeout);
@@ -330,14 +335,14 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
          *
          */
         private void resetState() {
-            openSocketTimeout = false;
-            openSocketTimeoutWait = false;
-            writeToSocketTimeoutWait = false;
+            openSockTimeout = false;
+            openSockTimeoutWait = false;
+            writeToSockTimeoutWait = false;
             err = null;
             validTimeout = true;
             connCheckStatusMsgCntSent = 0;
             connCheckStatusMsgCntReceived = 0;
-            countConnCheckMsg = false;
+            cntConnCheckMsg = false;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
index 8a7150d..d080b54 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -1467,19 +1467,19 @@ public abstract class GridAbstractTest extends TestCase {
         TcpDiscoverySpi discoSpi = new TestTcpDiscoverySpi();
 
         if (isDebug()) {
-            discoSpi.setMaxMissedHeartbeats(Integer.MAX_VALUE);
+            cfg.setFailureDetectionTimeout(Integer.MAX_VALUE);
             cfg.setNetworkTimeout(Long.MAX_VALUE / 3);
         }
         else {
             // Set network timeout to 10 sec to avoid unexpected p2p class loading errors.
             cfg.setNetworkTimeout(10000);
 
-            // Increase max missed heartbeats to avoid unexpected node fails.
-            discoSpi.setMaxMissedHeartbeats(30);
+            // Increase failure detection timeoute to avoid unexpected node fails.
+            cfg.setFailureDetectionTimeout(300000);
         }
 
-        // Set heartbeat interval to 1 second to speed up tests.
-        discoSpi.setHeartbeatFrequency(1000);
+        // Set metrics update interval to 1 second to speed up tests.
+        cfg.setMetricsUpdateFrequency(1000);
 
         String mcastAddr = GridTestUtils.getNextMulticastGroup(getClass());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/core/src/test/webapp/META-INF/ignite-webapp-config.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/webapp/META-INF/ignite-webapp-config.xml b/modules/core/src/test/webapp/META-INF/ignite-webapp-config.xml
index cb781e0..429ff15 100644
--- a/modules/core/src/test/webapp/META-INF/ignite-webapp-config.xml
+++ b/modules/core/src/test/webapp/META-INF/ignite-webapp-config.xml
@@ -208,7 +208,6 @@
                         <property name="bucketName" value="YOUR_BUCKET_NAME_IP_FINDER"/>
                     </bean>
                 </property>
-                <property name="heartbeatFrequency" value="2000"/>
             </bean>
         </property>
         -->

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
index fd5822a..b409a5a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
@@ -21,7 +21,6 @@ namespace Apache.Ignite.Core.Tests.Cache
     using System.Threading;
     using Apache.Ignite.Core.Cache;
     using Apache.Ignite.Core.Cache.Configuration;
-    using Apache.Ignite.Core.Discovery.Tcp;
     using Apache.Ignite.Core.Impl;
     using Apache.Ignite.Core.Impl.Cache;
     using NUnit.Framework;
@@ -228,7 +227,7 @@ namespace Apache.Ignite.Core.Tests.Cache
             localCache.Put(localKey, 1);
             localCache.Get(localKey);
             // Wait for metrics to propagate.
-            Thread.Sleep(TcpDiscoverySpi.DefaultHeartbeatFrequency);
+            Thread.Sleep(IgniteConfiguration.DefaultMetricsUpdateFrequency);
 
             var localMetrics = func(localCache);
             Assert.IsTrue(localMetrics.IsStatisticsEnabled);

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
index 31dd887..0524c05 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
@@ -726,7 +726,6 @@ namespace Apache.Ignite.Core.Tests
                     },
                     ClientReconnectDisabled = true,
                     ForceServerMode = true,
-                    HeartbeatFrequency = TimeSpan.FromSeconds(3),
                     IpFinderCleanFrequency = TimeSpan.FromMinutes(7),
                     LocalAddress = "127.0.0.1",
                     LocalPort = 49900,

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
index 8da2616..b0ed0d2 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
@@ -480,7 +480,6 @@ namespace Apache.Ignite.Core.Tests
                     },
                     ClientReconnectDisabled = true,
                     ForceServerMode = true,
-                    HeartbeatFrequency = TimeSpan.FromSeconds(3),
                     IpFinderCleanFrequency = TimeSpan.FromMinutes(7),
                     LocalAddress = "127.0.0.1",
                     LocalPort = 49900,

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
b/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
index a99f7b0..bdf5780 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
@@ -88,11 +88,6 @@ namespace Apache.Ignite.Core.Discovery.Tcp
         public const int DefaultThreadPriority = 10;
 
         /// <summary>
-        /// Default value for the <see cref="HeartbeatFrequency"/> property.
-        /// </summary>
-        public static readonly TimeSpan DefaultHeartbeatFrequency = TimeSpan.FromSeconds(2);
-        
-        /// <summary>
         /// Default value for the <see cref="TopologyHistorySize"/> property.
         /// </summary>
         public const int DefaultTopologyHistorySize = 1000;
@@ -114,7 +109,6 @@ namespace Apache.Ignite.Core.Discovery.Tcp
             MaxMissedClientHeartbeats = DefaultMaxMissedClientHeartbeats;
             IpFinderCleanFrequency = DefaultIpFinderCleanFrequency;
             ThreadPriority = DefaultThreadPriority;
-            HeartbeatFrequency = DefaultHeartbeatFrequency;
             TopologyHistorySize = DefaultTopologyHistorySize;
         }
 
@@ -143,7 +137,6 @@ namespace Apache.Ignite.Core.Discovery.Tcp
             StatisticsPrintFrequency = reader.ReadLongAsTimespan();
             IpFinderCleanFrequency = reader.ReadLongAsTimespan();
             ThreadPriority = reader.ReadInt();
-            HeartbeatFrequency = reader.ReadLongAsTimespan();
             TopologyHistorySize = reader.ReadInt();
         }
 
@@ -248,13 +241,6 @@ namespace Apache.Ignite.Core.Discovery.Tcp
         public int ThreadPriority { get; set; }
 
         /// <summary>
-        /// Gets or sets delay between issuing of heartbeat messages. SPI sends heartbeat
messages
-        /// in configurable time interval to other nodes to notify them about its state.
-        /// </summary>
-        [DefaultValue(typeof(TimeSpan), "0:0:2")]
-        public TimeSpan HeartbeatFrequency { get; set; }
-
-        /// <summary>
         /// Gets or sets the size of topology snapshots history.
         /// </summary>
         [DefaultValue(DefaultTopologyHistorySize)]
@@ -298,7 +284,6 @@ namespace Apache.Ignite.Core.Discovery.Tcp
             writer.WriteLong((long) StatisticsPrintFrequency.TotalMilliseconds);
             writer.WriteLong((long) IpFinderCleanFrequency.TotalMilliseconds);
             writer.WriteInt(ThreadPriority);
-            writer.WriteLong((long) HeartbeatFrequency.TotalMilliseconds);
             writer.WriteInt(TopologyHistorySize);
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
index 67f2715..728e62b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
@@ -873,11 +873,6 @@
                                 </xs:documentation>
                             </xs:annotation>
                         </xs:attribute>
-                        <xs:attribute name="heartbeatFrequency" type="xs:string">
-                            <xs:annotation>
-                                <xs:documentation>Delay between issuing of heartbeat
messages. SPI sends heartbeat messages in configurable time interval to other nodes to notify
them about its state.</xs:documentation>
-                            </xs:annotation>
-                        </xs:attribute>
                         <xs:attribute name="ipFinderCleanFrequency" type="xs:string">
                             <xs:annotation>
                                 <xs:documentation>IP finder clean frequency.</xs:documentation>

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/MultiTieredCacheExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/MultiTieredCacheExample.cs
b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/MultiTieredCacheExample.cs
index c40814c..f7caa78 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/MultiTieredCacheExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/MultiTieredCacheExample.cs
@@ -93,7 +93,7 @@ namespace Apache.Ignite.Examples.Datagrid
 
                 Console.WriteLine(">>> Waiting for metrics final update...");
 
-                Thread.Sleep(TcpDiscoverySpi.DefaultHeartbeatFrequency);
+                Thread.Sleep(IgniteConfiguration.DefaultMetricsUpdateFrequency);
 
                 PrintCacheMetrics(cache);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/urideploy/src/test/java/org/apache/ignite/p2p/GridP2PDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/urideploy/src/test/java/org/apache/ignite/p2p/GridP2PDisabledSelfTest.java
b/modules/urideploy/src/test/java/org/apache/ignite/p2p/GridP2PDisabledSelfTest.java
index da51d68..2cfaa46 100644
--- a/modules/urideploy/src/test/java/org/apache/ignite/p2p/GridP2PDisabledSelfTest.java
+++ b/modules/urideploy/src/test/java/org/apache/ignite/p2p/GridP2PDisabledSelfTest.java
@@ -83,7 +83,7 @@ public class GridP2PDisabledSelfTest extends GridCommonAbstractTest {
             cfg.setDeploymentSpi(depSpi);
         }
 
-        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setHeartbeatFrequency(500);
+        cfg.setMetricsUpdateFrequency(500);
 
         return cfg;
     }
@@ -212,4 +212,4 @@ public class GridP2PDisabledSelfTest extends GridCommonAbstractTest {
 
         checkGar();
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/6998785a/modules/web/src/test/webapp2/META-INF/ignite-webapp-config.xml
----------------------------------------------------------------------
diff --git a/modules/web/src/test/webapp2/META-INF/ignite-webapp-config.xml b/modules/web/src/test/webapp2/META-INF/ignite-webapp-config.xml
index e504fe7..9cb2761 100644
--- a/modules/web/src/test/webapp2/META-INF/ignite-webapp-config.xml
+++ b/modules/web/src/test/webapp2/META-INF/ignite-webapp-config.xml
@@ -199,7 +199,6 @@
                         <property name="bucketName" value="YOUR_BUCKET_NAME_IP_FINDER"/>
                     </bean>
                 </property>
-                <property name="heartbeatFrequency" value="2000"/>
             </bean>
         </property>
         -->


Mime
View raw message