You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by gv...@apache.org on 2019/01/11 14:06:42 UTC

[ignite] branch master updated: IGNITE-10756: MVCC: Query trackers are not released sometimes. This closes #5789.

This is an automated email from the ASF dual-hosted git repository.

gvvinblade pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new d36ffc6  IGNITE-10756: MVCC: Query trackers are not released sometimes. This closes #5789.
d36ffc6 is described below

commit d36ffc6c7707c56c91379e60aacd4f3ae8dd0a1e
Author: rkondakov <ko...@mail.ru>
AuthorDate: Fri Jan 11 17:06:10 2019 +0300

    IGNITE-10756: MVCC: Query trackers are not released sometimes. This closes #5789.
---
 .../cache/mvcc/CacheMvccAbstractTest.java          | 24 +++++++++++-----------
 .../mvcc/CacheMvccBasicContinuousQueryTest.java    |  2 --
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java
index 343fd59..29eb572 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java
@@ -76,6 +76,7 @@ import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException;
 import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException;
 import org.apache.ignite.internal.util.future.GridCompoundIdentityFuture;
 import org.apache.ignite.internal.util.lang.GridAbsPredicate;
+import org.apache.ignite.internal.util.lang.GridCloseableIterator;
 import org.apache.ignite.internal.util.lang.GridInClosure3;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.G;
@@ -1632,21 +1633,20 @@ public abstract class CacheMvccAbstractTest extends GridCommonAbstractTest {
                 if (!cctx.userCache() || !cctx.group().mvccEnabled() || F.isEmpty(cctx.group().caches()) || cctx.shared().closed(cctx))
                     continue;
 
-                for (Iterator it = cache.withKeepBinary().iterator(); it.hasNext(); ) {
-                    IgniteBiTuple entry = (IgniteBiTuple)it.next();
+                try (GridCloseableIterator it = (GridCloseableIterator)cache.withKeepBinary().iterator()) {
+                    while (it.hasNext()) {
+                        IgniteBiTuple entry = (IgniteBiTuple)it.next();
 
-                    KeyCacheObject key = cctx.toCacheKeyObject(entry.getKey());
+                        KeyCacheObject key = cctx.toCacheKeyObject(entry.getKey());
 
-                    List<IgniteBiTuple<Object, MvccVersion>> vers = cctx.offheap().mvccAllVersions(cctx, key)
-                        .stream().filter(t -> t.get1() != null).collect(Collectors.toList());
+                        List<IgniteBiTuple<Object, MvccVersion>> vers = cctx.offheap().mvccAllVersions(cctx, key)
+                            .stream().filter(t -> t.get1() != null).collect(Collectors.toList());
 
-                    if (vers.size() > 1) {
-                        if (failIfNotCleaned)
-                            fail("[key=" + key.value(null, false) + "; vers=" + vers + ']');
-                        else {
-                            U.closeQuiet((AutoCloseable)it);
-
-                            return false;
+                        if (vers.size() > 1) {
+                            if (failIfNotCleaned)
+                                fail("[key=" + key.value(null, false) + "; vers=" + vers + ']');
+                            else
+                                return false;
                         }
                     }
                 }
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccBasicContinuousQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccBasicContinuousQueryTest.java
index e05b846..e4c8180 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccBasicContinuousQueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccBasicContinuousQueryTest.java
@@ -398,7 +398,6 @@ public class CacheMvccBasicContinuousQueryTest extends CacheMvccAbstractTest  {
     /**
      * @throws Exception  If failed.
      */
-    @Ignore("https://issues.apache.org/jira/browse/IGNITE-10756")
     @Test
     public void testUpdateCountersGapClosedPartitioned() throws Exception {
         checkUpdateCountersGapsClosed(CacheMode.PARTITIONED);
@@ -554,7 +553,6 @@ public class CacheMvccBasicContinuousQueryTest extends CacheMvccAbstractTest  {
         assertEquals(range * 2, arrivedEvts.size());
 
         cur.close();
-        nearNode.close();
     }
 
     /**