ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [24/50] incubator-ignite git commit: sp-3-p1 protected ping by busy lock
Date Tue, 21 Apr 2015 09:41:44 GMT
sp-3-p1 protected ping by busy lock


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

Branch: refs/heads/ignite-499_1
Commit: ba96cba6cd20a03a7659e91748a8ccfa2858773a
Parents: 63faf7f
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Fri Apr 17 16:27:34 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Fri Apr 17 16:27:34 2015 +0300

----------------------------------------------------------------------
 .../managers/discovery/GridDiscoveryManager.java     | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ba96cba6/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 9f74b83..3ad1594 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -173,6 +173,9 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
     /** Map of dynamic cache filters. */
     private Map<String, CachePredicate> registeredCaches = new HashMap<>();
 
+    /** */
+    private final GridSpinBusyLock busyLock = new GridSpinBusyLock();
+
     /** @param ctx Context. */
     public GridDiscoveryManager(GridKernalContext ctx) {
         super(ctx, ctx.config().getDiscoverySpi());
@@ -914,6 +917,8 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
 
     /** {@inheritDoc} */
     @Override public void stop(boolean cancel) throws IgniteCheckedException {
+        busyLock.block();
+
         // Stop receiving notifications.
         getSpi().setListener(null);
 
@@ -973,7 +978,15 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
     public boolean pingNode(UUID nodeId) {
         assert nodeId != null;
 
-        return getSpi().pingNode(nodeId);
+        if (!busyLock.enterBusy())
+            return false;
+
+        try {
+            return getSpi().pingNode(nodeId);
+        }
+        finally {
+            busyLock.leaveBusy();
+        }
     }
 
     /**


Mime
View raw message