geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [18/22] geode git commit: GEODE-2193 Now we don't send view if shutdown process is started.
Date Thu, 13 Apr 2017 17:18:39 GMT
GEODE-2193 Now we don't send view if shutdown process is started.

Earlier we were checking flag, which was set after sending the shutdown
message. Now we check flag, which was set before sending the shutdown
message.


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

Branch: refs/heads/feature/GEODE-2632
Commit: c9b036b40d3eed0028629d6e90c833da96063986
Parents: bc22184
Author: Hitesh Khamesra <hkhamesra@pivotal.io>
Authored: Tue Apr 11 14:32:08 2017 -0700
Committer: Hitesh Khamesra <hkhamesra@pivotal.io>
Committed: Wed Apr 12 13:11:16 2017 -0700

----------------------------------------------------------------------
 .../geode/distributed/internal/DistributionManager.java     | 4 ++++
 .../internal/membership/gms/interfaces/Manager.java         | 9 ++++++++-
 .../internal/membership/gms/membership/GMSJoinLeave.java    | 7 +++++--
 .../internal/membership/gms/mgr/GMSMembershipManager.java   | 7 +++++++
 4 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/c9b036b4/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionManager.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionManager.java
index 3efbafc..2ae86e6 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionManager.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionManager.java
@@ -2342,6 +2342,10 @@ public class DistributionManager implements DM {
     return false;
   }
 
+  public boolean isShutdownStarted() {
+    return closeInProgress;
+  }
+
   private void handleViewInstalledEvent(ViewInstalledEvent ev) {
     synchronized (this.membershipViewIdGuard) {
       this.membershipViewIdAcknowledged = ev.getViewId();

http://git-wip-us.apache.org/repos/asf/geode/blob/c9b036b4/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Manager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Manager.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Manager.java
index 3fe8cc1..be69574 100755
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Manager.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Manager.java
@@ -100,10 +100,17 @@ public interface Manager extends Service, MessageHandler {
   Throwable getShutdownCause();
 
   /**
-   * Returns true if a shutdown is in progress or has been completed
+   * Returns true if a shutdown is in progress or has been completed . When it returns true,
+   * shutdown message is already sent.
    */
   boolean shutdownInProgress();
 
+  /**
+   * Returns true if a distributed system close is started. And shutdown msg has not sent
yet,its in
+   * progress.
+   */
+  boolean isShutdownStarted();
+
   // /**
   // * similar to forceDisconnect but is used solely by Messenger
   // * to tell Manager that communications have been lost

http://git-wip-us.apache.org/repos/asf/geode/blob/c9b036b4/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
index e4066ef..e0c0ba2 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
@@ -818,7 +818,8 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
   boolean prepareView(NetView view, List<InternalDistributedMember> newMembers)
       throws InterruptedException {
     if (services.getCancelCriterion().isCancelInProgress()
-        || services.getManager().shutdownInProgress()) {
+        || services.getManager().shutdownInProgress()
+        || services.getManager().isShutdownStarted()) {
       throw new InterruptedException("shutting down");
     }
     return sendView(view, true, this.prepareProcessor);
@@ -827,7 +828,8 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
   void sendView(NetView view, List<InternalDistributedMember> newMembers)
       throws InterruptedException {
     if (services.getCancelCriterion().isCancelInProgress()
-        || services.getManager().shutdownInProgress()) {
+        || services.getManager().shutdownInProgress()
+        || services.getManager().isShutdownStarted()) {
       throw new InterruptedException("shutting down");
     }
     sendView(view, false, this.viewProcessor);
@@ -2125,6 +2127,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
             } catch (DistributedSystemDisconnectedException e) {
               shutdown = true;
             } catch (InterruptedException e) {
+              logger.info("View Creator thread interrupted");
               shutdown = true;
             }
             requests = null;

http://git-wip-us.apache.org/repos/asf/geode/blob/c9b036b4/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
index 0180ddb..8ae66d0 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
@@ -2579,4 +2579,11 @@ public class GMSMembershipManager implements MembershipManager, Manager
{
     }
   }
 
+
+  @Override
+  public boolean isShutdownStarted() {
+    DistributionManager dm = listener.getDM();
+    return shutdownInProgress || (dm != null && dm.isShutdownStarted());
+  }
+
 }


Mime
View raw message