geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasonhu...@apache.org
Subject [geode] branch develop updated: GEODE-6339: centralize thread name string (#3139)
Date Thu, 31 Jan 2019 17:46:24 GMT
This is an automated email from the ASF dual-hosted git repository.

jasonhuynh pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 1a6ca26  GEODE-6339: centralize thread name string (#3139)
1a6ca26 is described below

commit 1a6ca26e89c3d3d413b22f6090467fb39db51ebb
Author: Bill Burcham <bill.burcham@gmail.com>
AuthorDate: Thu Jan 31 09:46:07 2019 -0800

    GEODE-6339: centralize thread name string (#3139)
---
 .../org/apache/geode/distributed/internal/DistributionMessage.java   | 2 +-
 .../src/main/java/org/apache/geode/internal/tcp/Connection.java      | 5 +++--
 .../src/main/java/org/apache/geode/internal/util/PluckStacks.java    | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java
index d2d441c..7a9e3d7 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java
@@ -496,7 +496,7 @@ public abstract class DistributionMessage implements DataSerializableFixedID,
Cl
       if (pid != 0) {
         procId = " processorId=" + pid;
       }
-      if (Thread.currentThread().getName().startsWith("P2P message reader")) {
+      if (Thread.currentThread().getName().startsWith(Connection.THREAD_KIND_IDENTIFIER))
{
         sender = procId;
       } else {
         sender = "sender=" + getSender() + procId;
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 941bd55..7f182d4 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
@@ -90,6 +90,7 @@ import org.apache.geode.internal.util.concurrent.ReentrantSemaphore;
  */
 public class Connection implements Runnable {
   private static final Logger logger = LogService.getLogger();
+  public static final String THREAD_KIND_IDENTIFIER = "P2P message reader";
 
   private static int P2P_CONNECT_TIMEOUT;
   private static boolean IS_P2P_CONNECT_TIMEOUT_INITIALIZED = false;
@@ -1602,7 +1603,7 @@ public class Connection implements Runnable {
   private String p2pReaderName() {
     StringBuilder sb = new StringBuilder(64);
     if (this.isReceiver) {
-      sb.append("P2P message reader@");
+      sb.append(THREAD_KIND_IDENTIFIER + "@");
     } else if (this.handshakeRead) {
       sb.append("P2P message sender@");
     } else {
@@ -3348,7 +3349,7 @@ public class Connection implements Runnable {
   }
 
   private void setThreadName(int dominoNumber) {
-    Thread.currentThread().setName("P2P message reader for " + this.remoteAddr + " "
+    Thread.currentThread().setName(THREAD_KIND_IDENTIFIER + " for " + this.remoteAddr + "
"
         + (this.sharedResource ? "" : "un") + "shared" + " " + (this.preserveOrder ? "" :
"un")
         + "ordered" + " uid=" + this.uniqueId + (dominoNumber > 0 ? (" dom #" + dominoNumber)
: "")
         + " port=" + this.socket.getPort());
diff --git a/geode-core/src/main/java/org/apache/geode/internal/util/PluckStacks.java b/geode-core/src/main/java/org/apache/geode/internal/util/PluckStacks.java
index 4663436..28201f2 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/util/PluckStacks.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/util/PluckStacks.java
@@ -32,6 +32,7 @@ import java.util.Map;
 import java.util.TreeMap;
 import java.util.zip.GZIPInputStream;
 
+import org.apache.geode.internal.tcp.Connection;
 import org.apache.geode.management.internal.cli.commands.ExportStackTraceCommand;
 
 /**
@@ -264,7 +265,7 @@ public class PluckStacks {
       // thread.get(2));
       return (stackSize == 8 && thread.get(2).contains("SocketChannelImpl.accept"));
     }
-    if (threadName.startsWith("P2P message reader")) {
+    if (threadName.startsWith(Connection.THREAD_KIND_IDENTIFIER)) {
       return (stackSize <= 14 && (thread.getFirstFrame().contains("FileDispatcherImpl.read")
           || thread.getFirstFrame().contains("FileDispatcher.read")
           || thread.getFirstFrame().contains("SocketDispatcher.read")));


Mime
View raw message