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: fixing a possible memory leak
Date Wed, 23 Dec 2015 18:34:30 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 2a21b7047 -> 093ac12e5


fixing a possible memory leak

GMSMembershipManager thought it was destroying artifacts for shunned
members who had expired but it wasn't.


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

Branch: refs/heads/develop
Commit: 093ac12e5106388c2ee33e2cca140856f1e4aa91
Parents: 2a21b70
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Wed Dec 23 10:34:10 2015 -0800
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Wed Dec 23 10:34:10 2015 -0800

----------------------------------------------------------------------
 .../gms/mgr/GMSMembershipManager.java           | 21 +++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/093ac12e/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
index 8ce5178..7fe55e5 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
@@ -2160,14 +2160,18 @@ public class GMSMembershipManager implements MembershipManager, Manager
     // the iterator.
     Set oldMembers = new HashSet(shunnedMembers.entrySet());
     
+    Set removedMembers = new HashSet();
+    
     Iterator it = oldMembers.iterator();
     while (it.hasNext()) {
       Map.Entry e = (Map.Entry)it.next();
       
       // Key is the member.  Value is the time to remove it.
       long ll = ((Long)e.getValue()).longValue(); 
-      if (ll >= deathTime)
+      if (ll >= deathTime) {
         continue; // too new.
+      }
+      
       InternalDistributedMember mm = (InternalDistributedMember)e.getKey();
 
       if (latestView.contains(mm)) {
@@ -2179,10 +2183,21 @@ public class GMSMembershipManager implements MembershipManager, Manager
         // will depart on its own accord, but we force the issue here.)
         destroyMember(mm, true, "shunned but never disconnected");
       }
-      if (logger.isDebugEnabled())
+      if (logger.isDebugEnabled()) {
         logger.debug("Membership: finally removed shunned member entry <{}>", mm);
-    } // while
+      }
+      
+      removedMembers.add(mm);
+    }
     
+    // removed timed-out entries from the shunned-members collections
+    if (removedMembers.size() > 0) {
+      it = removedMembers.iterator();
+      while (it.hasNext()) {
+        InternalDistributedMember idm = (InternalDistributedMember)it.next();
+        endShun(idm);
+      }
+    }
   }
   
   


Mime
View raw message