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

sshenoy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 94f539d700 HDDS-9816. NPE for access to MXBean during shutdown of OM. 
(#5709)
94f539d700 is described below

commit 94f539d700940fc2b3e82fc8094e0504b6df66d4
Author: Sumit Agrawal <[email protected]>
AuthorDate: Mon Dec 11 15:52:11 2023 +0530

    HDDS-9816. NPE for access to MXBean during shutdown of OM. (#5709)
---
 .../src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java       | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
index b2ddec9585..0e9eebaa04 100644
--- 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
+++ 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
@@ -2223,7 +2223,6 @@ public final class OzoneManager extends 
ServiceRuntimeInfoImpl
       }
       if (omRatisServer != null) {
         omRatisServer.stop();
-        omRatisServer = null;
         OMHAMetrics.unRegister();
       }
       isOmRpcServerRunning = false;
@@ -2260,6 +2259,7 @@ public final class OzoneManager extends 
ServiceRuntimeInfoImpl
       if (omhaMetrics != null) {
         OMHAMetrics.unRegister();
       }
+      omRatisServer = null;
       return true;
     } catch (Exception e) {
       LOG.error("OzoneManager stop failed.", e);
@@ -3034,6 +3034,9 @@ public final class OzoneManager extends 
ServiceRuntimeInfoImpl
     int port = omNodeDetails.getRatisPort();
     RaftPeer leaderId;
     if (isRatisEnabled) {
+      if (null == omRatisServer) {
+        return "Server is shutting down";
+      }
       try {
         leaderId = omRatisServer.getLeader();
         if (leaderId == null) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to