geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [17/50] [abbrv] incubator-geode git commit: GEODE-1645 forceUDPMessagingForCurrentThread should be re-enabled
Date Wed, 10 Aug 2016 19:41:03 GMT
GEODE-1645 forceUDPMessagingForCurrentThread should be re-enabled

This reenables use of UDP-only messaging for a thread.  PDX uses this
if conserve-sockets=true and it is executing a transaction in a
socket-reader thread to avoid possible deadlock situations.


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

Branch: refs/heads/feature/GEODE-420
Commit: 151b272a6fb64e78227c0d874008966cd3a77bde
Parents: 4dfe6b1
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Tue Aug 2 10:37:13 2016 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Tue Aug 2 10:37:13 2016 -0700

----------------------------------------------------------------------
 .../gms/mgr/GMSMembershipManager.java           | 29 +++++++++++---------
 1 file changed, 16 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/151b272a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
index 4ed30a4..33c57e0 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
@@ -123,7 +123,11 @@ public class GMSMembershipManager implements MembershipManager, Manager
    * avoid deadlock when conserve-sockets=true.  Use of this should be removed
    * when connection pools are implemented in the direct-channel 
    */
-  private ThreadLocal<Boolean> forceUseUDPMessaging = new ThreadLocal<Boolean>();
+  private ThreadLocal<Boolean> forceUseUDPMessaging = new ThreadLocal<Boolean>()
{
+    @Override protected Boolean initialValue() {
+      return Boolean.FALSE;
+    }
+  };
   
   /**
    * Trick class to make the startup synch more
@@ -1943,12 +1947,6 @@ public class GMSMembershipManager implements MembershipManager, Manager
     }
   }
   
-  // MembershipManager method
-  @Override
-  public void forceUDPMessagingForCurrentThread() {
-    forceUseUDPMessaging.set(null);
-  }
-  
   void checkAddressesForUUIDs(InternalDistributedMember[] addresses) {
     for (int i=0; i<addresses.length; i++) {
       InternalDistributedMember m = addresses[i];
@@ -1965,18 +1963,23 @@ public class GMSMembershipManager implements MembershipManager, Manager
       }
     }
   }
-  
-  private boolean isForceUDPCommunications() {
-    Boolean forced = forceUseUDPMessaging.get();
-    return forced == Boolean.TRUE;
+
+  // MembershipManager method
+  @Override
+  public void forceUDPMessagingForCurrentThread() {
+    forceUseUDPMessaging.set(Boolean.TRUE);
   }
 
   // MembershipManager method
   @Override
   public void releaseUDPMessagingForCurrentThread() {
-    // not currently supported by this manager
+    forceUseUDPMessaging.set(Boolean.FALSE);
   }
-  
+
+  private boolean isForceUDPCommunications() {
+    return forceUseUDPMessaging.get();
+  }
+
   public void setShutdown()
   {
     latestViewWriteLock.lock();


Mime
View raw message