This is an automated email from the ASF dual-hosted git repository. krathbun pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit c1ebeb6e9cb489cd96a6ca337811be9d00684e35 Merge: 6e974f1b4d cd87901aa2 Author: Kevin Rathbun <kevinrr...@gmail.com> AuthorDate: Thu Jun 12 09:08:09 2025 -0400 Merge branch '2.1' .../accumulo/core/clientImpl/ClientContext.java | 6 +++++- .../core/clientImpl/ThriftTransportPool.java | 24 +++++++++++++++++----- .../org/apache/accumulo/server/ServerContext.java | 6 ++++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --cc core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java index 5856a4a690,c2bcabe01e..dfce81a241 --- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java +++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java @@@ -1146,23 -1118,14 +1146,27 @@@ public class ClientContext implements A } public synchronized ThriftTransportPool getTransportPool() { + return getTransportPoolImpl(false); + } + + protected synchronized ThriftTransportPool getTransportPoolImpl(boolean shouldHalt) { ensureOpen(); if (thriftTransportPool == null) { - thriftTransportPool = - ThriftTransportPool.startNew(this::getTransportPoolMaxAgeMillis, shouldHalt); + LongSupplier maxAgeSupplier = () -> { + try { + return getTransportPoolMaxAgeMillis(); + } catch (IllegalStateException e) { + if (closed.get()) { + // The transport pool has a background thread that may call this supplier in the middle + // of closing. This is here to avoid spurious exceptions from race conditions that + // happen when closing a client. + return ConfigurationTypeHelper + .getTimeInMillis(ClientProperty.RPC_TRANSPORT_IDLE_TIMEOUT.getDefaultValue()); + } + throw e; + } + }; - thriftTransportPool = ThriftTransportPool.startNew(maxAgeSupplier); ++ thriftTransportPool = ThriftTransportPool.startNew(maxAgeSupplier, shouldHalt); } return thriftTransportPool; } diff --cc server/base/src/main/java/org/apache/accumulo/server/ServerContext.java index 0db05aca52,a2a1f93fd4..c7164b224c --- a/server/base/src/main/java/org/apache/accumulo/server/ServerContext.java +++ b/server/base/src/main/java/org/apache/accumulo/server/ServerContext.java @@@ -43,7 -42,7 +43,8 @@@ import java.util.function.Supplier import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.clientImpl.ClientContext; +import org.apache.accumulo.core.clientImpl.ClientInfo; + import org.apache.accumulo.core.clientImpl.ThriftTransportPool; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.DefaultConfiguration; import org.apache.accumulo.core.conf.Property;