This is an automated email from the ASF dual-hosted git repository.
ddanielr 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 979617a912 Modifies log message based on PortSearch prop (#4593)
979617a912 is described below
commit 979617a912a48f7c5ae01be6bbfe45c26394b143
Author: Daniel Roberts <[email protected]>
AuthorDate: Thu Jun 6 14:05:52 2024 -0400
Modifies log message based on PortSearch prop (#4593)
* Modifies log message based on PortSearch prop
Changes the log message emitted by the TServerUtils class to drop
severity and change message format if the respective valid port
search property is set.
---
.../org/apache/accumulo/server/rpc/TServerUtils.java | 18 ++++++++++++------
.../org/apache/accumulo/gc/SimpleGarbageCollector.java | 2 +-
.../apache/accumulo/test/functional/ZombieTServer.java | 2 +-
.../apache/accumulo/test/performance/NullTserver.java | 2 +-
4 files changed, 15 insertions(+), 9 deletions(-)
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 642d81a5c8..9375b3af90 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
@@ -181,7 +181,7 @@ public class TServerUtils {
return TServerUtils.startTServer(serverType, timedProcessor, serverName,
threadName,
minThreads, threadTimeOut, config, timeBetweenThreadChecks,
maxMessageSize,
context.getServerSslParams(), context.getSaslParams(),
context.getClientTimeoutInMillis(),
- backlog, addresses);
+ backlog, portSearch, addresses);
} catch (TTransportException e) {
if (portSearch) {
// Build a list of reserved ports - as identified by properties of
type PropertyType.PORT
@@ -206,7 +206,7 @@ public class TServerUtils {
return TServerUtils.startTServer(serverType, timedProcessor,
serverName, threadName,
minThreads, threadTimeOut, config, timeBetweenThreadChecks,
maxMessageSize,
context.getServerSslParams(), context.getSaslParams(),
- context.getClientTimeoutInMillis(), backlog, addr);
+ context.getClientTimeoutInMillis(), backlog, portSearch, addr);
} catch (TTransportException tte) {
log.info("Unable to use port {}, retrying. (Thread Name = {})",
port, threadName);
}
@@ -569,7 +569,8 @@ public class TServerUtils {
ThriftServerType serverType, TProcessor processor, String serverName,
String threadName,
int numThreads, long threadTimeOut, long timeBetweenThreadChecks, long
maxMessageSize,
SslConnectionParams sslParams, SaslServerConnectionParams saslParams,
- long serverSocketTimeout, int backlog, MetricsInfo metricsInfo,
HostAndPort... addresses) {
+ long serverSocketTimeout, int backlog, MetricsInfo metricsInfo, boolean
portSearch,
+ HostAndPort... addresses) {
if (serverType == ThriftServerType.SASL) {
processor = updateSaslProcessor(serverType, processor);
@@ -578,7 +579,7 @@ public class TServerUtils {
try {
return startTServer(serverType, new TimedProcessor(processor,
metricsInfo), serverName,
threadName, numThreads, threadTimeOut, conf,
timeBetweenThreadChecks, maxMessageSize,
- sslParams, saslParams, serverSocketTimeout, backlog, addresses);
+ sslParams, saslParams, serverSocketTimeout, backlog, portSearch,
addresses);
} catch (TTransportException e) {
throw new IllegalStateException(e);
}
@@ -595,7 +596,8 @@ public class TServerUtils {
String serverName, String threadName, int numThreads, long threadTimeOut,
final AccumuloConfiguration conf, long timeBetweenThreadChecks, long
maxMessageSize,
SslConnectionParams sslParams, SaslServerConnectionParams saslParams,
- long serverSocketTimeout, int backlog, HostAndPort... addresses) throws
TTransportException {
+ long serverSocketTimeout, int backlog, boolean portSearch,
HostAndPort... addresses)
+ throws TTransportException {
TProtocolFactory protocolFactory = ThriftUtil.protocolFactory();
// This is presently not supported. It's hypothetically possible, I
believe, to work, but it
// would require changes in how the transports
@@ -642,7 +644,11 @@ public class TServerUtils {
}
break;
} catch (TTransportException e) {
- log.warn("Error attempting to create server at {}. Error: {}",
address, e.getMessage());
+ if (portSearch) {
+ log.debug("Failed attempting to create server at {}. {}", address,
e.getMessage());
+ } else {
+ log.warn("Error attempting to create server at {}. Error: {}",
address, e.getMessage());
+ }
}
}
if (serverAddress == null) {
diff --git
a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
index 6a7025a979..9cafbd1fe1 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
@@ -401,7 +401,7 @@ public class SimpleGarbageCollector extends AbstractServer
implements Iface {
getContext().getThriftServerType(), processor,
this.getClass().getSimpleName(),
"GC Monitor Service", 2, ThreadPools.DEFAULT_TIMEOUT_MILLISECS, 1000,
maxMessageSize,
getContext().getServerSslParams(), getContext().getSaslParams(), 0,
- getConfiguration().getCount(Property.RPC_BACKLOG),
getContext().getMetricsInfo(),
+ getConfiguration().getCount(Property.RPC_BACKLOG),
getContext().getMetricsInfo(), false,
addresses);
log.debug("Starting garbage collector listening on " + server.address);
return server.address;
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java
b/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java
index 30d8331c93..5650c71670 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java
@@ -125,7 +125,7 @@ public class ZombieTServer {
ServerAddress serverPort =
TServerUtils.startTServer(context.getConfiguration(),
ThriftServerType.CUSTOM_HS_HA, muxProcessor, "ZombieTServer", "walking
dead", 2,
ThreadPools.DEFAULT_TIMEOUT_MILLISECS, 1000, 10 * 1024 * 1024, null,
null, -1,
- context.getConfiguration().getCount(Property.RPC_BACKLOG),
context.getMetricsInfo(),
+ context.getConfiguration().getCount(Property.RPC_BACKLOG),
context.getMetricsInfo(), false,
HostAndPort.fromParts("0.0.0.0", port));
String addressString = serverPort.address.toString();
diff --git
a/test/src/main/java/org/apache/accumulo/test/performance/NullTserver.java
b/test/src/main/java/org/apache/accumulo/test/performance/NullTserver.java
index 67a689c4f5..8b7230448c 100644
--- a/test/src/main/java/org/apache/accumulo/test/performance/NullTserver.java
+++ b/test/src/main/java/org/apache/accumulo/test/performance/NullTserver.java
@@ -346,7 +346,7 @@ public class NullTserver {
TServerUtils.startTServer(context.getConfiguration(),
ThriftServerType.CUSTOM_HS_HA,
muxProcessor, "NullTServer", "null tserver", 2,
ThreadPools.DEFAULT_TIMEOUT_MILLISECS, 1000,
10 * 1024 * 1024, null, null, -1,
context.getConfiguration().getCount(Property.RPC_BACKLOG),
- context.getMetricsInfo(), HostAndPort.fromParts("0.0.0.0", opts.port));
+ context.getMetricsInfo(), false, HostAndPort.fromParts("0.0.0.0",
opts.port));
HostAndPort addr =
HostAndPort.fromParts(InetAddress.getLocalHost().getHostName(), opts.port);