geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [geode] 01/01: GEODE-5783: have a single source for ThreadFactory
Date Wed, 24 Oct 2018 20:35:44 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit aaf1ec318ca87ed5df882885774cced6401edaa7
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
AuthorDate: Wed Oct 24 13:33:35 2018 -0700

    GEODE-5783: have a single source for ThreadFactory
    
    Use the keepalive parameter when initializing the thread factory.
    
    I also made some logging changes while debugging the problems this
    missing setting was causing.
---
 .../org/apache/geode/distributed/internal/ReplyMessage.java    | 10 ++++++----
 .../org/apache/geode/internal/cache/PartitionedRegion.java     |  2 +-
 .../geode/internal/cache/tier/sockets/CacheClientProxy.java    |  4 +++-
 .../org/apache/geode/internal/logging/LoggingExecutors.java    |  3 ++-
 .../main/java/org/apache/geode/internal/tcp/Connection.java    |  2 +-
 5 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/ReplyMessage.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/ReplyMessage.java
index bc8812d..41f35fb 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/ReplyMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/ReplyMessage.java
@@ -21,6 +21,7 @@ import java.io.IOException;
 
 import org.apache.logging.log4j.Logger;
 
+import org.apache.geode.CancelException;
 import org.apache.geode.DataSerializer;
 import org.apache.geode.InvalidDeltaException;
 import org.apache.geode.cache.EntryNotFoundException;
@@ -97,12 +98,13 @@ public class ReplyMessage extends HighPriorityDistributionMessage {
       m.returnValueIsException = true;
     }
     if (exception != null && logger.isDebugEnabled()) {
-      if (exception.getCause() != null
-          && (exception.getCause() instanceof EntryNotFoundException)) {
+      Throwable cause = exception.getCause();
+      if (cause instanceof EntryNotFoundException) {
         logger.debug("Replying with entry-not-found: {}", exception.getCause().getMessage());
-      } else if (exception.getCause() != null
-          && (exception.getCause() instanceof ConcurrentCacheModificationException))
{
+      } else if (cause instanceof ConcurrentCacheModificationException) {
         logger.debug("Replying with concurrent-modification-exception");
+      } else if (cause instanceof CancelException) {
+        // no need to log this - it will show up in normal debug-level logs when the reply
is sent
       } else {
         logger.debug("Replying with exception: " + m, exception);
       }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
index 5a669f1..9053b63 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
@@ -7079,7 +7079,7 @@ public class PartitionedRegion extends LocalRegion
       boolean callbackEvents) {
 
     if (logger.isDebugEnabled()) {
-      logger.debug("Destoying parallel queue region for senders: {}",
+      logger.debug("Destroying parallel queue region for senders: {}",
           this.getParallelGatewaySenderIds());
     }
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
index 7a8977d..b96eb53 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
@@ -2309,7 +2309,9 @@ public class CacheClientProxy implements ClientSession {
             && InternalDistributedSystem.getAnyInstance().getConfig().getDeltaPropagation()
             && !(this._proxy.clientConflation == Handshake.CONFLATION_ON);
         if ((createDurableQueue || canHandleDelta) && logger.isDebugEnabled()) {
-          logger.debug("Creating a durable HA queue");
+          logger.debug("Creating a {} subscription queue for {}",
+              createDurableQueue ? "durable" : "non-durable",
+              proxy.getProxyID());
         }
         this._messageQueue = HARegionQueue.getHARegionQueueInstance(getProxy().getHARegionName(),
             getCache(), harq, HARegionQueue.BLOCKING_HA_QUEUE, createDurableQueue,
diff --git a/geode-core/src/main/java/org/apache/geode/internal/logging/LoggingExecutors.java
b/geode-core/src/main/java/org/apache/geode/internal/logging/LoggingExecutors.java
index 6d9f644..5f206ae 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/logging/LoggingExecutors.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/logging/LoggingExecutors.java
@@ -171,7 +171,8 @@ public class LoggingExecutors {
     final BlockingQueue<Runnable> blockingQueue = new SynchronousQueue<>();
     ThreadFactory threadFactory =
         new LoggingThreadFactory(threadName, threadInitializer, commandWrapper);
-    return new ThreadPoolExecutor(corePoolSize, maximumPoolSize, 0, SECONDS, blockingQueue,
+    return new ThreadPoolExecutor(corePoolSize, maximumPoolSize, keepAliveSeconds, SECONDS,
+        blockingQueue,
         threadFactory);
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java b/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java
index 3fd36c5..13fba79 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java
@@ -1277,7 +1277,7 @@ public class Connection implements Runnable {
       }
     }
     if (logger.isDebugEnabled()) {
-      logger.debug("Connection: connected to {} with stub {}", remoteAddr, addr);
+      logger.debug("Connection: connected to {} with IP address {}", remoteAddr, addr);
     }
     try {
       getSocket().setTcpNoDelay(true);


Mime
View raw message