ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [06/18] incubator-ignite git commit: ignite-890: fixing
Date Thu, 16 Jul 2015 13:51:01 GMT
ignite-890: fixing


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

Branch: refs/heads/master
Commit: dce50db493421bad94679b2e067389c1a79afb14
Parents: b335500
Author: Denis Magda <dmagda@gridgain.com>
Authored: Mon Jul 13 13:06:36 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Mon Jul 13 13:06:36 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/spi/IgniteSpiAdapter.java     | 16 ++++++++++------
 .../org/apache/ignite/spi/IgniteSpiContext.java     |  6 ++++--
 .../apache/ignite/spi/discovery/tcp/ServerImpl.java | 12 ++++++++++--
 .../tcp/TcpDiscoveryMultiThreadedTest.java          |  4 ++--
 4 files changed, 26 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dce50db4/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
index 5e557bd..df043dd 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
@@ -545,17 +545,19 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
 
     /**
      * @param obj Timeout object.
+     * @throws IgniteSpiException Thrown in case of any error.
      * @see IgniteSpiContext#addTimeoutObject(IgniteSpiTimeoutObject)
      */
-    protected void addTimeoutObject(IgniteSpiTimeoutObject obj) {
+    protected void addTimeoutObject(IgniteSpiTimeoutObject obj) throws IgniteSpiException
{
         spiCtx.addTimeoutObject(obj);
     }
 
     /**
      * @param obj Timeout object.
+     * @throws IgniteSpiException Thrown in case of any error.
      * @see IgniteSpiContext#removeTimeoutObject(IgniteSpiTimeoutObject)
      */
-    protected void removeTimeoutObject(IgniteSpiTimeoutObject obj) {
+    protected void removeTimeoutObject(IgniteSpiTimeoutObject obj) throws IgniteSpiException
{
         spiCtx.removeTimeoutObject(obj);
     }
 
@@ -764,15 +766,17 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
         }
 
         /** {@inheritDoc} */
-        @Override public void addTimeoutObject(IgniteSpiTimeoutObject obj) {
-            assert ignite instanceof IgniteKernal : ignite;
+        @Override public void addTimeoutObject(IgniteSpiTimeoutObject obj) throws IgniteSpiException
{
+            if (!(ignite instanceof IgniteKernal))
+                throw new IgniteSpiException("Wrong Ignite instance is set: " + ignite);
 
             ((IgniteKernal)ignite).context().timeout().addTimeoutObject(new GridSpiTimeoutObject(obj));
         }
 
         /** {@inheritDoc} */
-        @Override public void removeTimeoutObject(IgniteSpiTimeoutObject obj) {
-            assert ignite instanceof IgniteKernal : ignite;
+        @Override public void removeTimeoutObject(IgniteSpiTimeoutObject obj) throws IgniteSpiException
{
+            if (!(ignite instanceof IgniteKernal))
+                throw new IgniteSpiException("Wrong Ignite instance is set: " + ignite);
 
             ((IgniteKernal)ignite).context().timeout().removeTimeoutObject(new GridSpiTimeoutObject(obj));
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dce50db4/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java
index 611702b..addf63f 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java
@@ -320,11 +320,13 @@ public interface IgniteSpiContext {
 
     /**
      * @param c Timeout object.
+     * @throws IgniteSpiException Thrown if any exception occurs.
      */
-    public void addTimeoutObject(IgniteSpiTimeoutObject c);
+    public void addTimeoutObject(IgniteSpiTimeoutObject c) throws IgniteSpiException;
 
     /**
      * @param c Timeout object.
+     * @throws IgniteSpiException Thrown if any exception occurs.
      */
-    public void removeTimeoutObject(IgniteSpiTimeoutObject c);
+    public void removeTimeoutObject(IgniteSpiTimeoutObject c) throws IgniteSpiException;
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dce50db4/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 4d4b2a7..ff33efa 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
@@ -3879,8 +3879,6 @@ class ServerImpl extends TcpDiscoveryImpl {
                         return;
                     }
 
-                    boolean res = pingNode(msg.nodeToPing());
-
                     final ClientMessageWorker worker = clientMsgWorkers.get(msg.creatorNodeId());
 
                     if (worker == null) {
@@ -3888,6 +3886,16 @@ class ServerImpl extends TcpDiscoveryImpl {
                             log.debug("Ping request from dead client node, will be skipped:
" + msg.creatorNodeId());
                     }
                     else {
+                        boolean res;
+
+                        try {
+                            res = pingNode(msg.nodeToPing());
+                        } catch (IgniteSpiException e) {
+                            log.error("Failed to ping node [nodeToPing=" + msg.nodeToPing()
+ ']', e);
+
+                            res = false;
+                        }
+
                         TcpDiscoveryClientPingResponse pingRes = new TcpDiscoveryClientPingResponse(
                             getLocalNodeId(), msg.nodeToPing(), res);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dce50db4/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
index 2aca2fb..b291b9c 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
@@ -37,10 +37,10 @@ import static org.apache.ignite.events.EventType.*;
  */
 public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest {
     /** */
-    private static final int GRID_CNT = 5;
+    private static final int GRID_CNT = 3;
 
     /** */
-    private static final int CLIENT_GRID_CNT = 5;
+    private static final int CLIENT_GRID_CNT = 2;
 
     /** */
     private static final ThreadLocal<Boolean> clientFlagPerThread = new ThreadLocal<>();


Mime
View raw message