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 229C818C17 for ; Tue, 9 Jun 2015 06:47:59 +0000 (UTC) Received: (qmail 34936 invoked by uid 500); 9 Jun 2015 06:47:59 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 34907 invoked by uid 500); 9 Jun 2015 06:47:59 -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 34898 invoked by uid 99); 9 Jun 2015 06:47:59 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jun 2015 06:47:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 96F1DC095F for ; Tue, 9 Jun 2015 06:47:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.771 X-Spam-Level: * X-Spam-Status: No, score=1.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Tj-a621jDYuL for ; Tue, 9 Jun 2015 06:47:51 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 31CA427D58 for ; Tue, 9 Jun 2015 06:47:48 +0000 (UTC) Received: (qmail 34437 invoked by uid 99); 9 Jun 2015 06:47: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; Tue, 09 Jun 2015 06:47:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DB3BBE025B; Tue, 9 Jun 2015 06:47:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergi@apache.org To: commits@ignite.incubator.apache.org Date: Tue, 09 Jun 2015 06:48:12 -0000 Message-Id: In-Reply-To: <2f02124015af44e0a406305c0c682c57@git.apache.org> References: <2f02124015af44e0a406305c0c682c57@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [27/50] incubator-ignite git commit: # ignite-883 # ignite-883 Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e237b00d Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e237b00d Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e237b00d Branch: refs/heads/ignite-484-1 Commit: e237b00d84039383723e00929b639fa62be03de7 Parents: fb827a77 Author: sboikov Authored: Fri Jun 5 16:12:46 2015 +0300 Committer: sboikov Committed: Fri Jun 5 18:10:34 2015 +0300 ---------------------------------------------------------------------- .../util/nio/GridNioRecoveryDescriptor.java | 11 ++++++--- .../ignite/spi/discovery/tcp/ServerImpl.java | 9 ++++--- .../tcp/TcpClientDiscoverySpiSelfTest.java | 25 ++++++++++++++++++++ 3 files changed, 37 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e237b00d/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java index 08a9937..3bc81ea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java @@ -176,9 +176,11 @@ public class GridNioRecoveryDescriptor { while (acked < rcvCnt) { GridNioFuture fut = msgFuts.pollFirst(); - assert fut != null; + assert fut != null : "Missed message future [rcvCnt=" + rcvCnt + + ", acked=" + acked + + ", desc=" + this + ']'; - assert fut.isDone(); + assert fut.isDone() : fut; acked++; } @@ -239,7 +241,10 @@ public class GridNioRecoveryDescriptor { * @param rcvCnt Number of messages received by remote node. */ public void onHandshake(long rcvCnt) { - ackReceived(rcvCnt); + synchronized (this) { + if (!nodeLeft) + ackReceived(rcvCnt); + } resendCnt = msgFuts.size(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e237b00d/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java index 302b721..0270a7c 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java @@ -1752,7 +1752,7 @@ class ServerImpl extends TcpDiscoveryImpl { @Nullable Collection messages(IgniteUuid lastMsgId) { assert lastMsgId != null; - Collection copy = new ArrayList<>(msgs.size()); + Collection cp = new ArrayList<>(msgs.size()); boolean skip = true; @@ -1762,10 +1762,10 @@ class ServerImpl extends TcpDiscoveryImpl { skip = false; } else - copy.add(msg); + cp.add(msg); } - return !skip ? copy : null; + return !skip ? cp : null; } /** @@ -2704,8 +2704,7 @@ class ServerImpl extends TcpDiscoveryImpl { node.aliveCheck(spi.maxMissedClientHbs); if (isLocalNodeCoordinator()) { - Collection pending = - pendingMsgs.messages(msg.lastMessageId()); + Collection pending = pendingMsgs.messages(msg.lastMessageId()); if (pending != null) { msg.pendingMessages(pending); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e237b00d/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java index f7be340..7333020 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java @@ -469,6 +469,31 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + public void testClientReconnectOneServerOneClient() throws Exception { + clientsPerSrv = 1; + + startServerNodes(1); + startClientNodes(1); + + checkNodes(1, 1); + + srvLeftLatch = new CountDownLatch(1); + srvFailedLatch = new CountDownLatch(1); + + attachListeners(1, 0); + + ((TcpDiscoverySpi)G.ignite("client-0").configuration().getDiscoverySpi()).brakeConnection(); + + assertFalse(srvFailedLatch.await(2000, TimeUnit.MILLISECONDS)); + + assertEquals(1L, srvLeftLatch.getCount()); + + checkNodes(1, 1); + } + + /** + * @throws Exception If failed. + */ public void testGetMissedMessagesOnReconnect() throws Exception { clientsPerSrv = 1;