ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ag...@apache.org
Subject ignite git commit: IGNITE-8311 IgniteClientRejoinTest.testClientsReconnectDisabled causes exchange-worker to terminate via NPE
Date Wed, 06 Jun 2018 11:34:59 GMT
Repository: ignite
Updated Branches:
  refs/heads/master ecca4ca25 -> 1adbc44d1


IGNITE-8311 IgniteClientRejoinTest.testClientsReconnectDisabled causes exchange-worker to
terminate via NPE

Signed-off-by: Andrey Gura <agura@apache.org>


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

Branch: refs/heads/master
Commit: 1adbc44d1b5d22616a42190082a5f0a24624c074
Parents: ecca4ca
Author: Dmitriy Sorokin <sbt.sorokin.dvl@gmail.com>
Authored: Wed Jun 6 14:34:04 2018 +0300
Committer: Andrey Gura <agura@apache.org>
Committed: Wed Jun 6 14:34:04 2018 +0300

----------------------------------------------------------------------
 .../GridCachePartitionExchangeManager.java      |  4 +-
 .../failure/FailureHandlerTriggeredTest.java    | 35 -----------
 .../ignite/failure/TestFailureHandler.java      | 63 ++++++++++++++++++++
 .../ignite/internal/IgniteClientRejoinTest.java | 11 +++-
 .../IgniteChangeGlobalStateTest.java            |  2 +
 .../CacheHibernateStoreFactorySelfTest.java     |  2 +
 .../CacheHibernateStoreFactorySelfTest.java     |  2 +
 .../query/IgniteSqlSchemaIndexingTest.java      |  5 +-
 .../jdbc/CacheJdbcBlobStoreFactorySelfTest.java |  2 +
 .../jdbc/CacheJdbcPojoStoreFactorySelfTest.java |  2 +
 10 files changed, 90 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1adbc44d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 6533bbc..3a99089 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -2358,7 +2358,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
         /**
          *
          */
-        private void body0() throws InterruptedException, IgniteInterruptedCheckedException
{
+        private void body0() throws InterruptedException, IgniteCheckedException {
             long timeout = cctx.gridConfig().getNetworkTimeout();
 
             long cnt = 0;
@@ -2662,6 +2662,8 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
                 catch (IgniteCheckedException e) {
                     U.error(log, "Failed to wait for completion of partition map exchange
" +
                         "(preloading will not start): " + task, e);
+
+                    throw e;
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/1adbc44d/modules/core/src/test/java/org/apache/ignite/failure/FailureHandlerTriggeredTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/failure/FailureHandlerTriggeredTest.java
b/modules/core/src/test/java/org/apache/ignite/failure/FailureHandlerTriggeredTest.java
index 5eca7d6..8d56ced 100644
--- a/modules/core/src/test/java/org/apache/ignite/failure/FailureHandlerTriggeredTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/failure/FailureHandlerTriggeredTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.failure;
 
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
-import org.apache.ignite.Ignite;
 import org.apache.ignite.internal.IgniteEx;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
 import org.apache.ignite.internal.processors.cache.CachePartitionExchangeWorkerTask;
@@ -67,40 +66,6 @@ public class FailureHandlerTriggeredTest extends GridCommonAbstractTest
{
     }
 
     /**
-     * Test failure handler implementation
-     */
-    private class TestFailureHandler implements FailureHandler {
-        /** Invalidate. */
-        private final boolean invalidate;
-
-        /** Latch. */
-        private final CountDownLatch latch;
-
-        /** Failure context. */
-        volatile FailureContext failureCtx;
-
-        /**
-         * @param invalidate Invalidate.
-         * @param latch Latch.
-         */
-        TestFailureHandler(boolean invalidate, CountDownLatch latch) {
-            this.invalidate = invalidate;
-            this.latch = latch;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean onFailure(Ignite ignite, FailureContext failureCtx) {
-            this.failureCtx = failureCtx;
-
-            this.latch.countDown();
-
-            ignite.log().warning("Handled ignite failure: " + failureCtx);
-
-            return invalidate;
-        }
-    }
-
-    /**
      * Custom exchange worker task implementation for delaying exchange worker processing.
      */
     static class ExchangeWorkerFailureTask extends SchemaExchangeWorkerTask implements CachePartitionExchangeWorkerTask
{

http://git-wip-us.apache.org/repos/asf/ignite/blob/1adbc44d/modules/core/src/test/java/org/apache/ignite/failure/TestFailureHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/failure/TestFailureHandler.java
b/modules/core/src/test/java/org/apache/ignite/failure/TestFailureHandler.java
new file mode 100644
index 0000000..1159683
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/failure/TestFailureHandler.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.failure;
+
+import java.util.concurrent.CountDownLatch;
+import org.apache.ignite.Ignite;
+
+/**
+ * Test failure handler implementation
+ */
+public class TestFailureHandler implements FailureHandler {
+    /** Invalidate. */
+    private final boolean invalidate;
+
+    /** Latch. */
+    private final CountDownLatch latch;
+
+    /** Failure context. */
+    volatile FailureContext failureCtx;
+
+    /**
+     * @param invalidate Invalidate.
+     * @param latch Latch.
+     */
+    public TestFailureHandler(boolean invalidate, CountDownLatch latch) {
+        this.invalidate = invalidate;
+        this.latch = latch;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean onFailure(Ignite ignite, FailureContext failureCtx) {
+        this.failureCtx = failureCtx;
+
+        if (latch != null)
+            latch.countDown();
+
+        ignite.log().warning("Handled ignite failure: " + failureCtx);
+
+        return invalidate;
+    }
+
+    /**
+     * @return Failure context.
+     */
+    public FailureContext failureContext() {
+        return failureCtx;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/1adbc44d/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientRejoinTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientRejoinTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientRejoinTest.java
index 462c8ab..9a98a88 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientRejoinTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientRejoinTest.java
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Random;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteCheckedException;
@@ -35,6 +36,7 @@ import org.apache.ignite.IgniteException;
 import org.apache.ignite.Ignition;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.failure.TestFailureHandler;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteInClosure;
 import org.apache.ignite.plugin.extensions.communication.Message;
@@ -282,6 +284,8 @@ public class IgniteClientRejoinTest extends GridCommonAbstractTest {
 
         final int CLIENTS_NUM = 5;
 
+        final CountDownLatch failureHndLatch = new CountDownLatch(CLIENTS_NUM);
+
         for (int i = 0; i < CLIENTS_NUM; i++) {
             final int idx = i;
 
@@ -289,7 +293,10 @@ public class IgniteClientRejoinTest extends GridCommonAbstractTest {
                 @Override public Ignite call() throws Exception {
                     latch.await();
 
-                    return startGrid("client" + idx);
+                    String igniteInstanceName = "client" + idx;
+
+                    return startGrid(igniteInstanceName, getConfiguration(igniteInstanceName)
+                        .setFailureHandler(new TestFailureHandler(true, failureHndLatch)));
                 }
             });
 
@@ -309,6 +316,8 @@ public class IgniteClientRejoinTest extends GridCommonAbstractTest {
             }, IgniteCheckedException.class, null);
         }
 
+        assertTrue(failureHndLatch.await(1000, TimeUnit.MILLISECONDS));
+
         assertEquals(0, srv1.cluster().forClients().nodes().size());
         assertEquals(0, srv2.cluster().forClients().nodes().size());
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/1adbc44d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java
index cbf0ec9..9152ab9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java
@@ -543,6 +543,8 @@ public class IgniteChangeGlobalStateTest extends IgniteChangeGlobalStateAbstract
      * @throws Exception If failed.
      */
     public void testActivateAfterFailGetLock() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-1094");
+
         Ignite ig1P = primary(0);
         Ignite ig2P = primary(1);
         Ignite ig3P = primary(2);

http://git-wip-us.apache.org/repos/asf/ignite/blob/1adbc44d/modules/hibernate-4.2/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hibernate-4.2/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
b/modules/hibernate-4.2/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
index 0dab22c..db0e1be 100644
--- a/modules/hibernate-4.2/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
+++ b/modules/hibernate-4.2/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
@@ -83,6 +83,8 @@ public class CacheHibernateStoreFactorySelfTest extends GridCommonAbstractTest
{
      * @throws Exception If failed.
      */
     public void testIncorrectBeanConfiguration() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-1094");
+
         GridTestUtils.assertThrows(log, new Callable<Object>() {
             @Override public Object call() throws Exception {
                 try(Ignite ignite =

http://git-wip-us.apache.org/repos/asf/ignite/blob/1adbc44d/modules/hibernate-5.1/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hibernate-5.1/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
b/modules/hibernate-5.1/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
index a329f2b..0ffe52e 100644
--- a/modules/hibernate-5.1/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
+++ b/modules/hibernate-5.1/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
@@ -83,6 +83,8 @@ public class CacheHibernateStoreFactorySelfTest extends GridCommonAbstractTest
{
      * @throws Exception If failed.
      */
     public void testIncorrectBeanConfiguration() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-1094");
+
         GridTestUtils.assertThrows(log, new Callable<Object>() {
             @Override public Object call() throws Exception {
                 try(Ignite ignite =

http://git-wip-us.apache.org/repos/asf/ignite/blob/1adbc44d/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemaIndexingTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemaIndexingTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemaIndexingTest.java
index e375df2..2dee617 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemaIndexingTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemaIndexingTest.java
@@ -87,7 +87,8 @@ public class IgniteSqlSchemaIndexingTest extends GridCommonAbstractTest
{
      */
     public void testCaseSensitive() throws Exception {
         //TODO rewrite with dynamic cache creation, and GRID start in #beforeTest after resolve
of
-        //https://issues.apache.org/jira/browse/IGNITE-1094
+        //TODO https://issues.apache.org/jira/browse/IGNITE-1094
+        fail("https://issues.apache.org/jira/browse/IGNITE-1094");
 
         GridTestUtils.assertThrows(log, new Callable<Object>() {
             @Override public Object call() throws Exception {
@@ -117,6 +118,8 @@ public class IgniteSqlSchemaIndexingTest extends GridCommonAbstractTest
{
     public void testCustomSchemaMultipleCachesTablesCollision() throws Exception {
         //TODO: Rewrite with dynamic cache creation, and GRID start in #beforeTest after
resolve of
         //TODO: https://issues.apache.org/jira/browse/IGNITE-1094
+        fail("https://issues.apache.org/jira/browse/IGNITE-1094");
+
         GridTestUtils.assertThrows(log, new Callable<Object>() {
             @Override public Object call() throws Exception {
                 final CacheConfiguration cfg = cacheConfig("cache1", true, Integer.class,
Fact.class)

http://git-wip-us.apache.org/repos/asf/ignite/blob/1adbc44d/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
index bc4f268..be2238b 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
@@ -77,6 +77,8 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest
{
      * @throws Exception If failed.
      */
     public void testIncorrectBeanConfiguration() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-1094");
+
         GridTestUtils.assertThrows(log, new Callable<Object>() {
             @Override public Object call() throws Exception {
                 try(Ignite ignite = Ignition.start("modules/spring/src/test/config/incorrect-store-cache.xml"))
{

http://git-wip-us.apache.org/repos/asf/ignite/blob/1adbc44d/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
index 0d6d6a2..ba4984d 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
@@ -69,6 +69,8 @@ public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest
{
      * @throws Exception If failed.
      */
     public void testIncorrectBeanConfiguration() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-1094");
+
         GridTestUtils.assertThrowsAnyCause(log, new Callable<Object>() {
             @Override public Object call() throws Exception {
                 try (Ignite ignored = Ignition.start("modules/spring/src/test/config/pojo-incorrect-store-cache.xml"))
{


Mime
View raw message