Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-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 9F8D0178EB for ; Wed, 15 Apr 2015 10:16:16 +0000 (UTC) Received: (qmail 19567 invoked by uid 500); 15 Apr 2015 10:16:10 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 19526 invoked by uid 500); 15 Apr 2015 10:16:10 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 19509 invoked by uid 99); 15 Apr 2015 10:16:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Apr 2015 10:16:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 15 Apr 2015 10:16:09 +0000 Received: (qmail 16564 invoked by uid 99); 15 Apr 2015 10:15:46 -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; Wed, 15 Apr 2015 10:15:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6D6B1E0332; Wed, 15 Apr 2015 10:15:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Wed, 15 Apr 2015 10:16:10 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [26/37] incubator-ignite git commit: # ignite-sprint-4 added put retries in test X-Virus-Checked: Checked by ClamAV on apache.org # ignite-sprint-4 added put retries in test Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8b904516 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8b904516 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8b904516 Branch: refs/heads/ignite-738 Commit: 8b904516afff7cf49492494660e691a015dfd4f3 Parents: 4fe2a9a Author: sboikov Authored: Wed Apr 15 11:01:48 2015 +0300 Committer: sboikov Committed: Wed Apr 15 11:01:48 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/GridCachePutAllTask.java | 30 ++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b904516/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllTask.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllTask.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllTask.java index 479ff9c..f9d49f6 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllTask.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllTask.java @@ -91,6 +91,8 @@ class GridCachePutAllTask extends ComputeTaskAdapter, Void> int cnt = 0; + final int RETRIES = 5; + while (it.hasNext()) { Integer val = it.next(); @@ -102,7 +104,19 @@ class GridCachePutAllTask extends ComputeTaskAdapter, Void> else log.info("Putting keys to cache [size=" + putMap.size() + ']'); - cache.putAll(putMap); + for (int i = 0; i < RETRIES; i++) { + try { + cache.putAll(putMap); + + break; + } + catch (IgniteException e) { + if (i < RETRIES - 1) + log.info("Put error, will retry: " + e); + else + throw e; + } + } cnt = 0; @@ -118,7 +132,19 @@ class GridCachePutAllTask extends ComputeTaskAdapter, Void> else log.info("Putting keys to cache [size=" + putMap.size() + ']'); - cache.putAll(putMap); + for (int i = 0; i < RETRIES; i++) { + try { + cache.putAll(putMap); + + break; + } + catch (IgniteException e) { + if (i < RETRIES - 1) + log.info("Put error, will retry: " + e); + else + throw e; + } + } if (DEBUG_DATA) log.info("Finished putting data: " + data);