This is an automated email from the ASF dual-hosted git repository.

dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit 37d676a873a1af8eac498967ab291583d18ef8ec
Merge: 7dadc796d4 e1ac8553f4
Author: Dave Marion <dlmar...@apache.org>
AuthorDate: Mon Jun 2 22:00:00 2025 +0000

    Merge branch '2.1'

 .../org/apache/accumulo/core/lock/ServiceLockSupport.java    | 12 ++++++------
 .../core/util/threads/AccumuloUncaughtExceptionHandler.java  |  1 +
 .../org/apache/accumulo/core/util/threads/ThreadPools.java   |  8 ++++----
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --cc 
core/src/main/java/org/apache/accumulo/core/lock/ServiceLockSupport.java
index 7b8cac777c,efc335faf0..19be1b6f4f
--- a/core/src/main/java/org/apache/accumulo/core/lock/ServiceLockSupport.java
+++ b/core/src/main/java/org/apache/accumulo/core/lock/ServiceLockSupport.java
@@@ -79,10 -53,10 +79,10 @@@ public class ServiceLockSupport 
      @Override
      public void lostLock(LockLossReason reason) {
        if (shutdownComplete.get()) {
-         LOG.warn("{} lost lock (reason = {}), not halting because shutdown is 
complete.", server,
-             reason);
 -        Halt.halt(0, serviceName + " lock in zookeeper lost (reason = " + 
reason
++        Halt.halt(0, server + " lock in zookeeper lost (reason = " + reason
+             + "), exiting cleanly because shutdown is complete.");
        } else {
 -        Halt.halt(-1, serviceName + " lock in zookeeper lost (reason = " + 
reason + "), exiting!");
 +        Halt.halt(-1, server + " lock in zookeeper lost (reason = " + reason 
+ "), exiting!");
        }
      }
  
@@@ -149,15 -123,15 +149,13 @@@
     */
    public static class ServiceLockWatcher implements LockWatcher {
  
--    private static final Logger LOG = 
LoggerFactory.getLogger(ServiceLockWatcher.class);
--
 -    private final String serviceName;
 +    private final Type server;
      private final Supplier<Boolean> shutdownComplete;
 -    private final Consumer<String> lostLockAction;
 +    private final Consumer<Type> lostLockAction;
  
 -    public ServiceLockWatcher(String serviceName, Supplier<Boolean> 
shutdownComplete,
 -        Consumer<String> lostLockAction) {
 -      this.serviceName = serviceName;
 +    public ServiceLockWatcher(Type server, Supplier<Boolean> shutdownComplete,
 +        Consumer<Type> lostLockAction) {
 +      this.server = server;
        this.shutdownComplete = shutdownComplete;
        this.lostLockAction = lostLockAction;
      }
@@@ -165,11 -139,13 +163,13 @@@
      @Override
      public void lostLock(final LockLossReason reason) {
        if (shutdownComplete.get()) {
-         LOG.warn("{} lost lock (reason = {}), not halting because shutdown is 
complete.", server,
-             reason);
+         Halt.halt(0,
 -            serviceName + " lost lock (reason = " + reason
++            server + " lost lock (reason = " + reason
+                 + "), exiting cleanly because shutdown is complete.",
 -            () -> lostLockAction.accept(serviceName));
++            () -> lostLockAction.accept(server));
        } else {
 -        Halt.halt(1, serviceName + " lost lock (reason = " + reason + "), 
exiting.",
 -            () -> lostLockAction.accept(serviceName));
 +        Halt.halt(1, server + " lost lock (reason = " + reason + "), 
exiting.",
 +            () -> lostLockAction.accept(server));
        }
      }
  

Reply via email to