Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 793DA185C8 for ; Tue, 1 Mar 2016 00:09:14 +0000 (UTC) Received: (qmail 76580 invoked by uid 500); 1 Mar 2016 00:09:14 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 76546 invoked by uid 500); 1 Mar 2016 00:09:14 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 76537 invoked by uid 99); 1 Mar 2016 00:09:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2016 00:09:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id D528F1804DF for ; Tue, 1 Mar 2016 00:09:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.549 X-Spam-Level: X-Spam-Status: No, score=-3.549 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.329] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id fc_TMQS0lZl1 for ; Tue, 1 Mar 2016 00:09:12 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id AD6095FB0D for ; Tue, 1 Mar 2016 00:09:11 +0000 (UTC) Received: (qmail 76254 invoked by uid 99); 1 Mar 2016 00:09:10 -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; Tue, 01 Mar 2016 00:09:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id ABF0EDFD86; Tue, 1 Mar 2016 00:09:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Tue, 01 Mar 2016 00:09:11 -0000 Message-Id: In-Reply-To: <599b4e984d2c4192a4360a707d57f56b@git.apache.org> References: <599b4e984d2c4192a4360a707d57f56b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/34] incubator-geode git commit: GEODE-979 CI Failure: ParameterBindingJUnitTest.testMultithreadedBindUsingSameQueryObject failed with NullPointerException GEODE-979 CI Failure: ParameterBindingJUnitTest.testMultithreadedBindUsingSameQueryObject failed with NullPointerException LinkedList should not be added to concurrently Moved some of the latch logic to guarantee that all threads are queued before starting Added an awaitTerminate call to make sure all threads are done working before returning results Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/d50623b0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/d50623b0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/d50623b0 Branch: refs/heads/feature/GEODE-949-2 Commit: d50623b04f253b51182114c9fd277db20afeba8b Parents: 4951bfa Author: Jason Huynh Authored: Wed Feb 24 14:05:08 2016 -0800 Committer: Jason Huynh Committed: Wed Feb 24 14:58:09 2016 -0800 ---------------------------------------------------------------------- .../gemstone/gemfire/cache/query/MultithreadedTester.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d50623b0/geode-core/src/test/java/com/gemstone/gemfire/cache/query/MultithreadedTester.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/MultithreadedTester.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/MultithreadedTester.java index 3142566..adea4a3 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/MultithreadedTester.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/MultithreadedTester.java @@ -31,14 +31,15 @@ public class MultithreadedTester { public static Collection runMultithreaded(Collection callables) throws InterruptedException { - final CountDownLatch allRunnablesAreSubmitted = new CountDownLatch(1); + final CountDownLatch allRunnablesAreSubmitted = new CountDownLatch(callables.size()); final CountDownLatch callablesComplete = new CountDownLatch(callables.size()); final ExecutorService executor = Executors.newFixedThreadPool(callables.size()); final LinkedList futures = new LinkedList<>(); //Submit all tasks to the executor - callables.parallelStream().forEach(callable -> { + callables.forEach(callable -> { futures.add(executor.submit(() -> { try { + allRunnablesAreSubmitted.countDown(); allRunnablesAreSubmitted.await(60, TimeUnit.SECONDS); return callable.call(); } @@ -50,11 +51,10 @@ public class MultithreadedTester { } })); }); - //Unlock all tasks - allRunnablesAreSubmitted.countDown(); //Wait until all tasks are complete callablesComplete.await(60, TimeUnit.SECONDS); executor.shutdown(); + executor.awaitTermination(60, TimeUnit.SECONDS); return convertFutureToResult(futures); }