You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/07/20 12:57:22 UTC

incubator-ignite git commit: ignite-1032: implemented

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-1032 cf0818114 -> 22d3a1767


ignite-1032: implemented


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/22d3a176
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/22d3a176
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/22d3a176

Branch: refs/heads/ignite-1032
Commit: 22d3a1767898ec9d9183dfb8429b79257641b8d7
Parents: cf08181
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Jul 20 13:57:11 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jul 20 13:57:11 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 59 ++++++++++++--------
 1 file changed, 35 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/22d3a176/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 4861953..6d39031 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
@@ -3536,7 +3536,7 @@ class ServerImpl extends TcpDiscoveryImpl {
          *
          * @param msg Status check message.
          */
-        private void processStatusCheckMessage(TcpDiscoveryStatusCheckMessage msg) {
+        private void processStatusCheckMessage(final TcpDiscoveryStatusCheckMessage msg) {
             assert msg != null;
 
             UUID locNodeId = getLocalNodeId();
@@ -3576,35 +3576,46 @@ class ServerImpl extends TcpDiscoveryImpl {
                         // Sender is not in topology, it should reconnect.
                         msg.status(STATUS_RECON);
 
-                        try {
-                            trySendMessageDirectly(msg.creatorNode(), msg);
+                        utilityPool.execute(new Runnable() {
+                            /** {@inheritDoc} */
+                            @Override public void run() {
+                                if (spiState == DISCONNECTED) {
+                                    if (log.isDebugEnabled())
+                                        log.debug("Ignoring status check request, SPI is already disconnected: " + msg);
 
-                            if (log.isDebugEnabled())
-                                log.debug("Responded to status check message " +
-                                    "[recipient=" + msg.creatorNodeId() + ", status=" + msg.status() + ']');
-                        }
-                        catch (IgniteSpiException e) {
-                            if (e.hasCause(SocketException.class)) {
-                                if (log.isDebugEnabled()) {
-                                    log.debug("Failed to respond to status check message (connection refused) " +
-                                        "[recipient=" + msg.creatorNodeId() + ", status=" + msg.status() + ']');
+                                    return;
                                 }
 
-                                onException("Failed to respond to status check message (connection refused) " +
-                                    "[recipient=" + msg.creatorNodeId() + ", status=" + msg.status() + ']', e);
-                            }
-                            else {
-                                if (pingNode(msg.creatorNode())) {
-                                    // Node exists and accepts incoming connections.
-                                    U.error(log, "Failed to respond to status check message " +
-                                        "[recipient=" + msg.creatorNodeId() + ", status=" + msg.status() + ']', e);
+                                try {
+                                    trySendMessageDirectly(msg.creatorNode(), msg);
+
+                                    if (log.isDebugEnabled())
+                                        log.debug("Responded to status check message " +
+                                            "[recipient=" + msg.creatorNodeId() + ", status=" + msg.status() + ']');
                                 }
-                                else if (log.isDebugEnabled()) {
-                                    log.debug("Failed to respond to status check message (did the node stop?) " +
-                                        "[recipient=" + msg.creatorNodeId() + ", status=" + msg.status() + ']');
+                                catch (IgniteSpiException e) {
+                                    if (e.hasCause(SocketException.class)) {
+                                        if (log.isDebugEnabled())
+                                            log.debug("Failed to respond to status check message (connection " +
+                                                "refused) [recipient=" + msg.creatorNodeId() + ", status=" +
+                                                msg.status() + ']');
+
+                                        onException("Failed to respond to status check message (connection refused) " +
+                                            "[recipient=" + msg.creatorNodeId() + ", status=" + msg.status() + ']', e);
+                                    }
+                                    else {
+                                        if (pingNode(msg.creatorNode()))
+                                            // Node exists and accepts incoming connections.
+                                            U.error(log, "Failed to respond to status check message [recipient=" +
+                                                msg.creatorNodeId() + ", status=" + msg.status() + ']', e);
+                                        else if (log.isDebugEnabled())
+                                            log.debug("Failed to respond to status check message (did the node " +
+                                                "stop?) [recipient=" + msg.creatorNodeId() + ", status=" + msg.status()
+                                                + ']');
+                                    }
                                 }
                             }
-                        }
+                        });
                     }
 
                     return;