geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject incubator-geode git commit: GEODE-77 fixing uncaught exception in view creator
Date Fri, 06 Nov 2015 17:25:57 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-77 6b7ea8bb7 -> 0ab85392f


GEODE-77 fixing uncaught exception in view creator

check for inclusion in the new view before trying to set failure detection
port


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

Branch: refs/heads/feature/GEODE-77
Commit: 0ab85392f95811c83436ebd4ac4d19a48ae2424e
Parents: 6b7ea8b
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Fri Nov 6 09:25:43 2015 -0800
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Fri Nov 6 09:25:43 2015 -0800

----------------------------------------------------------------------
 .../membership/gms/fd/GMSHealthMonitor.java     | 52 +++++++++++++-------
 1 file changed, 33 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0ab85392/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
index 76a5540..0307f5b 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
@@ -17,6 +17,7 @@ import java.net.SocketTimeoutException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -119,6 +120,11 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler
{
    * Members currently being suspected and the view they were suspected in
    */
   final private ConcurrentHashMap<InternalDistributedMember, NetView> suspectedMemberInView
= new ConcurrentHashMap<>();
+  
+  /**
+   * Members undergoing final checks
+   */
+  final private List<InternalDistributedMember> membersInFinalCheck = Collections.synchronizedList(new
ArrayList<>(30));
 
   /**
    * Replies to messages
@@ -1090,27 +1096,32 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler
{
 
   private void doFinalCheck(final InternalDistributedMember initiator,
       List<SuspectRequest> sMembers, NetView cv, InternalDistributedMember localAddress)
{
-    for (int i = 0; i < sMembers.size(); i++) {
-      final SuspectRequest sr = sMembers.get(i);
-      final InternalDistributedMember mbr = sr.getSuspectMember();
 
-      if (!cv.contains(mbr)) {
-        continue;
-      }
+    List<InternalDistributedMember> membersChecked = new ArrayList<>(10);
+    try {
+      for (int i = 0; i < sMembers.size(); i++) {
+        final SuspectRequest sr = sMembers.get(i);
+        final InternalDistributedMember mbr = sr.getSuspectMember();
 
-      if (mbr.equals(localAddress)) {
-        continue;// self
-      }
+        if (!cv.contains(mbr) || membersInFinalCheck.contains(mbr)) {
+          continue;
+        }
 
-      // suspectMemberInView is now set by the heartbeat monitoring code
-      // to allow us to move on from watching members we've already
-      // suspected.  Since that code is updating this collection we
-      // cannot use it here as an indication that a member is currently
-      // undergoing a final check.
-//      NetView view;
-//      view = suspectedMemberInView.putIfAbsent(mbr, cv);
+        if (mbr.equals(localAddress)) {
+          continue;// self
+        }
+        
+        membersChecked.add(mbr);
+
+        // suspectMemberInView is now set by the heartbeat monitoring code
+        // to allow us to move on from watching members we've already
+        // suspected.  Since that code is updating this collection we
+        // cannot use it here as an indication that a member is currently
+        // undergoing a final check.
+        //      NetView view;
+        //      view = suspectedMemberInView.putIfAbsent(mbr, cv);
 
-//      if (view == null || !view.equals(cv)) {
+        //      if (view == null || !view.equals(cv)) {
         final String reason = sr.getReason();
         logger.debug("Scheduling final check for member {}; reason={}", mbr, reason);
         // its a coordinator
@@ -1138,7 +1149,7 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler
{
               } else {
                 pinged = GMSHealthMonitor.this.doTCPCheckMember(mbr, port);
               }
-              
+
               boolean failed = false;
               if (!pinged && !isStopping) {
                 TimeStamp ts = memberTimeStamps.get(mbr);
@@ -1166,7 +1177,10 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler
{
             }
           }
         });
-//      }// scheduling for final check and removing it..
+        //      }// scheduling for final check and removing it..
+      }
+    } finally {
+      membersInFinalCheck.removeAll(membersChecked);
     }
   }
 


Mime
View raw message