geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [geode] branch feature/GEODE-3948 updated: GEODE-3948 Improve CQ performance under flaky network conditions
Date Thu, 01 Feb 2018 00:43:15 GMT
This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch feature/GEODE-3948
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-3948 by this push:
     new e093db0  GEODE-3948 Improve CQ performance under flaky network conditions
e093db0 is described below

commit e093db0ff293e078888f1ab6700adfa633dd93bf
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
AuthorDate: Wed Jan 31 16:42:48 2018 -0800

    GEODE-3948 Improve CQ performance under flaky network conditions
    
    Addressing review comments.
---
 .../src/main/java/org/apache/geode/cache/client/Pool.java    | 12 +++---------
 .../main/java/org/apache/geode/cache/client/PoolFactory.java |  7 ++-----
 .../internal/cache/tier/sockets/CacheClientUpdater.java      |  6 +++++-
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/Pool.java b/geode-core/src/main/java/org/apache/geode/cache/client/Pool.java
index 6c76c3a..0701d52 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/Pool.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/Pool.java
@@ -297,15 +297,9 @@ public interface Pool {
    * A server has an inactivity monitor that ensures a message is sent to a client at least
once a
    * minute (60,000 milliseconds). If a subscription timeout multipler is set in the client
it
    * enables timing out of the subscription feed with failover to another server.
-   * <p>
-   * A value of zero (the default) disables timeouts
-   * <p>
-   * A value of one will time out the server connection after one of its ping intervals (not
-   * recommended)
-   * <p>
-   * A value of two or more will time out the server connection after that many ping intervals
have
-   * elapsed
-   *
+   * 
+   * @see PoolFactory#setSubscriptionTimeoutMultiplier(int)
+   * 
    * @return The timeout multiplier
    */
   int getSubscriptionTimeoutMultiplier();
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/PoolFactory.java b/geode-core/src/main/java/org/apache/geode/cache/client/PoolFactory.java
index 2c2ff0d..365eb07 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/PoolFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/PoolFactory.java
@@ -440,11 +440,8 @@ public interface PoolFactory {
    * <p>
    * A value of zero (the default) disables timeouts
    * <p>
-   * A value of one will time out the server connection after one of its ping intervals (not
-   * recommended)
-   * <p>
-   * A value of two or more will time out the server connection after that many ping intervals
have
-   * elapsed
+   * The resulting timeout will be multiplied by 1.25 in order to avoid race conditions with
the
+   * server sending its "ping" message.
    */
   public PoolFactory setSubscriptionTimeoutMultiplier(int multiplier);
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
index dd25b5b..efec266 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
@@ -1561,6 +1561,10 @@ public class CacheClientUpdater extends Thread implements ClientUpdater,
Disconn
    */
   private void processMessages() {
     final boolean isDebugEnabled = logger.isDebugEnabled();
+
+    final int headerReadTimeout = (int) Math.round(serverQueueStatus.getPingInterval()
+        * qManager.getPool().getSubscriptionTimeoutMultiplier() * 1.25);
+
     try {
       Message clientMessage = initializeMessage();
 
@@ -1595,7 +1599,7 @@ public class CacheClientUpdater extends Thread implements ClientUpdater,
Disconn
 
         try {
           // Read the message
-          clientMessage.receiveWithHeaderReadTimeout(serverQueueStatus.getPingInterval()
* 2);
+          clientMessage.receiveWithHeaderReadTimeout(headerReadTimeout);
 
           // Wait for the previously failed cache client updater
           // to finish. This will avoid out of order messages.

-- 
To stop receiving notification emails like this one, please contact
bschuchardt@apache.org.

Mime
View raw message