ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [2/3] ignite git commit: IGNITE-1378 - Fixed exception handling in GridContinuousProcessor.startRoutine()
Date Tue, 15 Sep 2015 06:43:11 GMT
IGNITE-1378 - Fixed exception handling in GridContinuousProcessor.startRoutine()


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

Branch: refs/heads/master
Commit: 1914c0216608dc8eecf97fb3ee4bdfb6fdec740c
Parents: f8b798d
Author: Valentin Kulichenko <valentin.kulichenko@gmail.com>
Authored: Mon Sep 14 23:37:26 2015 -0700
Committer: Valentin Kulichenko <valentin.kulichenko@gmail.com>
Committed: Mon Sep 14 23:37:26 2015 -0700

----------------------------------------------------------------------
 .../continuous/GridContinuousProcessor.java     | 22 +++++++-------------
 1 file changed, 7 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1914c021/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index 3dcfff8..18c1f36 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -566,30 +566,22 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
         startFuts.put(routineId, fut);
 
         try {
+            if (locIncluded && registerHandler(ctx.localNodeId(), routineId, hnd,
bufSize, interval, autoUnsubscribe, true))
+                hnd.onListenerRegistered(routineId, ctx);
+
             ctx.discovery().sendCustomEvent(new StartRoutineDiscoveryMessage(routineId, reqData));
         }
-        catch (IgniteCheckedException e) { // Marshaller exception may occurs if user pass
unmarshallable filter.
+        catch (IgniteCheckedException e) {
             startFuts.remove(routineId);
-
             locInfos.remove(routineId);
 
+            unregisterHandler(routineId, hnd, true);
+
             fut.onDone(e);
 
             return fut;
         }
 
-        // Register local handler if needed.
-        if (locIncluded) {
-            try {
-                if (registerHandler(ctx.localNodeId(), routineId, hnd, bufSize, interval,
autoUnsubscribe, true))
-                    hnd.onListenerRegistered(routineId, ctx);
-            }
-            catch (IgniteCheckedException e) {
-                return new GridFinishedFuture<>(
-                    new IgniteCheckedException("Failed to register handler locally: " + hnd,
e));
-            }
-        }
-
         // Handler is registered locally.
         fut.onLocalRegistered();
 
@@ -1624,4 +1616,4 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
             return S.toString(SyncMessageAckFuture.class, this);
         }
     }
-}
\ No newline at end of file
+}


Mime
View raw message