-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-9816. NPE for access to MXBean during shutdown of OM #5709
Conversation
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Show resolved
Hide resolved
@@ -3031,7 +3031,7 @@ public String getRatisRoles() { | |||
List<ServiceInfo> serviceList; | |||
int port = omNodeDetails.getRatisPort(); | |||
RaftPeer leaderId; | |||
if (isRatisEnabled) { | |||
if (isRatisEnabled && null != omRatisServer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Else is redundant at the end, also change the string to `Ratis disable or server shutting down"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @sumitagrawl for the change, @kerneltime for the review. |
This commit has broken compile on master. We either need to revert it or fix it ASAP.
Probably an overlap with:
Has caused the issue as the return type was changed there. |
Created #5764 to fix the compile error. |
What changes were proposed in this pull request?
while stopping OM, mbean is access to get ratis role, and the omRatisServer is set null after stopping server. As fix, omRatisServer is set at end to avoid if used other place, and added a null check.
This is not have much impact as other failure may happen if ratis server is stopped and accessed. Just avoiding NPE here.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9816
How was this patch tested?
NA