This is an automated email from the ASF dual-hosted git repository.
dlmarion pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/2.1 by this push:
new 355b0d726e Fix ACCUMULO_POOL_PREFIX usage for Thread pool names (#5141)
355b0d726e is described below
commit 355b0d726e3bebc2407e5f29e5bd965004f68bef
Author: Dave Marion <[email protected]>
AuthorDate: Thu Dec 5 10:42:28 2024 -0500
Fix ACCUMULO_POOL_PREFIX usage for Thread pool names (#5141)
Closes #5136
---
.../java/org/apache/accumulo/core/util/threads/ThreadPools.java | 8 ++++++--
.../main/java/org/apache/accumulo/server/rpc/TServerUtils.java | 2 +-
.../accumulo/tserver/compactions/InternalCompactionExecutor.java | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git
a/core/src/main/java/org/apache/accumulo/core/util/threads/ThreadPools.java
b/core/src/main/java/org/apache/accumulo/core/util/threads/ThreadPools.java
index b2b0bc02db..240a41459c 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/threads/ThreadPools.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/threads/ThreadPools.java
@@ -399,7 +399,7 @@ public class ThreadPools {
}
/**
- * Fet a fluent-style pool builder.
+ * Get a fluent-style pool builder.
*
* @param name the pool name - the name trimed and prepended with the
ACCUMULO_POOL_PREFIX so that
* pool names begin with a consistent prefix.
@@ -409,7 +409,11 @@ public class ThreadPools {
if (trimmed.startsWith(ACCUMULO_POOL_PREFIX.poolName)) {
return new ThreadPoolExecutorBuilder(trimmed);
} else {
- return new ThreadPoolExecutorBuilder(ACCUMULO_POOL_PREFIX.poolName +
trimmed);
+ if (trimmed.startsWith(".")) {
+ return new ThreadPoolExecutorBuilder(ACCUMULO_POOL_PREFIX.poolName +
trimmed);
+ } else {
+ return new ThreadPoolExecutorBuilder(ACCUMULO_POOL_PREFIX.poolName +
"." + trimmed);
+ }
}
}
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
b/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
index d4220ff6de..22a191a7a6 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
@@ -311,7 +311,7 @@ public class TServerUtils {
private static ThreadPoolExecutor createSelfResizingThreadPool(final String
serverName,
final int executorThreads, long threadTimeOut, final
AccumuloConfiguration conf,
long timeBetweenThreadChecks) {
- String poolName = ACCUMULO_POOL_PREFIX.poolName + serverName.toLowerCase()
+ ".client";
+ String poolName = ACCUMULO_POOL_PREFIX.poolName + "." +
serverName.toLowerCase() + ".client";
final ThreadPoolExecutor pool =
ThreadPools.getServerThreadPools().getPoolBuilder(poolName).numCoreThreads(executorThreads)
.withTimeOut(threadTimeOut,
MILLISECONDS).enableThreadPoolMetrics().build();
diff --git
a/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/InternalCompactionExecutor.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/InternalCompactionExecutor.java
index 66002556a3..618f6463b3 100644
---
a/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/InternalCompactionExecutor.java
+++
b/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/InternalCompactionExecutor.java
@@ -208,7 +208,7 @@ public class InternalCompactionExecutor implements
CompactionExecutor {
public void setThreads(int numThreads) {
ThreadPools.resizePool(threadPool, () -> numThreads,
- ACCUMULO_POOL_PREFIX.poolName + "accumulo.pool.compaction." + ceid);
+ ACCUMULO_POOL_PREFIX.poolName + ".accumulo.pool.compaction." + ceid);
}
@Override