geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [1/9] incubator-geode git commit: GEODE-1234: add a test hook to track client transactions scheduled to be removed.
Date Tue, 10 May 2016 21:08:18 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-951 bf9912bd8 -> e1d413056


GEODE-1234: add a test hook to track client transactions scheduled to be removed.


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

Branch: refs/heads/feature/GEODE-951
Commit: 0bf5425491a0ddbe0d614ab174be98957072f962
Parents: 3fe55d4
Author: eshu <eshu@pivotal.io>
Authored: Mon May 9 16:36:59 2016 -0700
Committer: eshu <eshu@pivotal.io>
Committed: Mon May 9 16:36:59 2016 -0700

----------------------------------------------------------------------
 .../cache/tier/sockets/ClientHealthMonitor.java       | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0bf54254/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientHealthMonitor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientHealthMonitor.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientHealthMonitor.java
index 93e543d..c0f5021 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientHealthMonitor.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientHealthMonitor.java
@@ -42,6 +42,7 @@ import com.gemstone.gemfire.internal.cache.IncomingGatewayStatus;
 import com.gemstone.gemfire.internal.cache.TXId;
 import com.gemstone.gemfire.internal.cache.TXManagerImpl;
 import com.gemstone.gemfire.internal.cache.tier.Acceptor;
+import com.gemstone.gemfire.internal.concurrent.ConcurrentHashSet;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.logging.LoggingThreadGroup;
@@ -278,6 +279,16 @@ public class ClientHealthMonitor {
       }
     }
   }
+  
+  private final Set<TXId> scheduledToBeRemovedTx = Boolean.getBoolean("gemfire.trackScheduledToBeRemovedTx")?

+      new ConcurrentHashSet<TXId>() : null;
+
+  /**
+   * provide a test hook to track client transactions to be removed
+   */
+  public Set<TXId> getScheduledToBeRemovedTx() {
+    return scheduledToBeRemovedTx;
+  }
 
   /**
    * expire the transaction states for the given client.  This uses the
@@ -298,13 +309,16 @@ public class ClientHealthMonitor {
       if (logger.isDebugEnabled()) {
         logger.debug("expiring {} transaction contexts for {} timeout={}", txids.size(),
proxyID, timeout/1000);
       }
+
       if (timeout <= 0) {
         txMgr.removeTransactions(txids, true);
       } else {
+        if (scheduledToBeRemovedTx != null) scheduledToBeRemovedTx.addAll(txids);       
         SystemTimerTask task = new SystemTimerTask() {
           @Override
           public void run2() {
             txMgr.removeTransactions(txids, true);
+            if (scheduledToBeRemovedTx != null) scheduledToBeRemovedTx.removeAll(txids);
           }
         };
         ((GemFireCacheImpl)this._cache).getCCPTimer().schedule(task, timeout);


Mime
View raw message