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

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


The following commit(s) were added to refs/heads/main by this push:
     new 535ec52172 avoid loss of error thrown from server run() (#5808)
535ec52172 is described below

commit 535ec521727ff88ff42cf82b578b1e6220a21bb7
Author: Keith Turner <[email protected]>
AuthorDate: Tue Aug 19 13:42:37 2025 -0400

    avoid loss of error thrown from server run() (#5808)
    
    Follow up to #5796 that attempts to handle the following case.
    
     1. server.runServer() throws an error
     2. server.close() throws en exception or error
    
    When the above happens the error will never be logged and its also not
    attached to the exception thrown in the finally block by server.close().
    Therefore the error is lost and there is no indication it happened. Changed
    the code to catch throwable to avoid loss of information in this case.
    
    
    Co-authored-by: Dave Marion <[email protected]>
---
 .../base/src/main/java/org/apache/accumulo/server/AbstractServer.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/server/base/src/main/java/org/apache/accumulo/server/AbstractServer.java 
b/server/base/src/main/java/org/apache/accumulo/server/AbstractServer.java
index 93cdf7a3af..e6543afe17 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/AbstractServer.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/AbstractServer.java
@@ -78,7 +78,7 @@ public abstract class AbstractServer
   public static void startServer(AbstractServer server, Logger LOG) throws 
Exception {
     try {
       server.runServer();
-    } catch (Exception e) {
+    } catch (Throwable e) {
       System.err
           .println(server.getClass().getSimpleName() + " died, exception 
thrown from runServer.");
       e.printStackTrace();
@@ -87,7 +87,7 @@ public abstract class AbstractServer
     } finally {
       try {
         server.close();
-      } catch (Exception e) {
+      } catch (Throwable e) {
         System.err.println("Exception thrown while closing " + 
server.getClass().getSimpleName());
         e.printStackTrace();
         LOG.error("Exception thrown while closing {}", 
server.getClass().getSimpleName(), e);

Reply via email to