Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 985E0200D0D for ; Fri, 25 Aug 2017 10:39:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9702F16C548; Fri, 25 Aug 2017 08:39:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C722D16C53E for ; Fri, 25 Aug 2017 10:39:46 +0200 (CEST) Received: (qmail 52661 invoked by uid 500); 25 Aug 2017 08:39:46 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 52063 invoked by uid 99); 25 Aug 2017 08:39:44 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Aug 2017 08:39:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9902CF5F2F; Fri, 25 Aug 2017 08:39:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Date: Fri, 25 Aug 2017 08:39:57 -0000 Message-Id: In-Reply-To: <5df358537b67458fac9fa7186f135b65@git.apache.org> References: <5df358537b67458fac9fa7186f135b65@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [15/18] ignite git commit: ignite-6175 JVM Crash in Ignite Binary Objects Simple Mapper Basic suite archived-at: Fri, 25 Aug 2017 08:39:47 -0000 ignite-6175 JVM Crash in Ignite Binary Objects Simple Mapper Basic suite Signed-off-by: Andrey Gura Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/24306bad Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/24306bad Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/24306bad Branch: refs/heads/ignite-6149 Commit: 24306badde225ee4b3edec53b2ae8d3e1c0bff8d Parents: 3ab523c Author: EdShangGG Authored: Thu Aug 24 19:15:24 2017 +0300 Committer: Andrey Gura Committed: Thu Aug 24 19:15:24 2017 +0300 ---------------------------------------------------------------------- .../processors/database/BPlusTreeSelfTest.java | 39 +++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/24306bad/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java index 4a32df2..9c0d791 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java @@ -54,6 +54,7 @@ import org.apache.ignite.internal.util.GridConcurrentHashSet; import org.apache.ignite.internal.util.GridRandom; import org.apache.ignite.internal.util.GridStripedLock; import org.apache.ignite.internal.util.IgniteTree; +import org.apache.ignite.internal.util.future.GridCompoundFuture; import org.apache.ignite.internal.util.lang.GridCursor; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.SB; @@ -112,11 +113,11 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest { /** */ private static final Collection rmvdIds = new GridConcurrentHashSet<>(); + /** Stop. */ + private final AtomicBoolean stop = new AtomicBoolean(); -// /** {@inheritDoc} */ -// @Override protected long getTestTimeout() { -// return 25 * 60 * 1000; -// } + /** Future. */ + private volatile GridCompoundFuture asyncRunFut; /** * Check that we do not keep any locks at the moment. @@ -127,6 +128,8 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest { /** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { + stop.set(false); + long seed = System.nanoTime(); X.println("Test seed: " + seed + "L; // "); @@ -156,6 +159,18 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest { rnd = null; try { + if (asyncRunFut != null && !asyncRunFut.isDone()) { + stop.set(true); + + try { + asyncRunFut.cancel(); + asyncRunFut.get(60000); + } + catch (Throwable ex) { + //Ignore + } + } + if (reuseList != null) { long size = reuseList.recycledPagesCount(); @@ -1316,7 +1331,7 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest { IgniteInternalFuture fut = multithreadedAsync(new Callable() { @Override public Object call() throws Exception { - for (int i = 0; i < loops; i++) { + for (int i = 0; i < loops && !stop.get(); i++) { final Long x = (long)DataStructure.randomInt(CNT); final int op = DataStructure.randomInt(4); @@ -1402,8 +1417,6 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest { } }, Runtime.getRuntime().availableProcessors(), "put-remove"); - final AtomicBoolean stop = new AtomicBoolean(); - IgniteInternalFuture fut2 = multithreadedAsync(new Callable() { @Override public Void call() throws Exception { while (!stop.get()) { @@ -1442,14 +1455,22 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest { } }, 4, "find"); + + asyncRunFut = new GridCompoundFuture<>(); + + asyncRunFut.add((IgniteInternalFuture)fut); + asyncRunFut.add((IgniteInternalFuture)fut2); + asyncRunFut.add((IgniteInternalFuture)fut3); + + asyncRunFut.markInitialized(); + try { fut.get(getTestTimeout(), TimeUnit.MILLISECONDS); } finally { stop.set(true); - fut2.get(); - fut3.get(); + asyncRunFut.get(); } GridCursor cursor = tree.find(null, null);