ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [01/17] incubator-ignite git commit: ignite-1189: clearing grid information on stop even when grid's state is not STARTED
Date Tue, 11 Aug 2015 17:35:54 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-1175 171caab0a -> 5479e9128 (forced update)


ignite-1189: clearing grid information on stop even when grid's state is not STARTED


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

Branch: refs/heads/ignite-1175
Commit: ac6d75dc55eab0ce909c972a1124bf5fb42a5e3d
Parents: aec9764
Author: Denis Magda <dmagda@gridgain.com>
Authored: Mon Aug 3 12:44:45 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Mon Aug 3 12:44:45 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgnitionEx.java  | 21 +++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac6d75dc/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 5cbe377..d355085 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -261,8 +261,11 @@ public class IgnitionEx {
     public static boolean stop(@Nullable String name, boolean cancel) {
         IgniteNamedInstance grid = name != null ? grids.get(name) : dfltGrid;
 
-        if (grid != null && grid.state() == STARTED) {
-            grid.stop(cancel);
+        if (grid != null) {
+            IgniteState state = grid.state();
+
+            if (state == STARTED)
+                grid.stop(cancel);
 
             boolean fireEvt;
 
@@ -277,10 +280,18 @@ public class IgnitionEx {
                 }
             }
 
-            if (fireEvt)
-                notifyStateChange(grid.getName(), grid.state());
+            if (state == STARTED) {
+                if (fireEvt)
+                    notifyStateChange(grid.getName(), grid.state());
 
-            return true;
+                return true;
+            }
+            else {
+                U.warn(null, "Ignoring stopping grid instance (has not been in STARTED state):
[grid=" + name +
+                    ", state=" + state + ']');
+
+                return false;
+            }
         }
 
         // We don't have log at this point...


Mime
View raw message