HDFS-17876. Add null check for tracer in NameNode.stop() to avoid NPE…#8336
Open
deepujain wants to merge 1 commit intoapache:trunkfrom
Open
HDFS-17876. Add null check for tracer in NameNode.stop() to avoid NPE…#8336deepujain wants to merge 1 commit intoapache:trunkfrom
deepujain wants to merge 1 commit intoapache:trunkfrom
Conversation
ayushtkn
reviewed
Mar 10, 2026
Member
ayushtkn
left a comment
There was a problem hiding this comment.
I think we can live without the test, it isn't testing something relevant, we are ourselves making it null via reflection,
We can drop the test, I am happy to merge it like that, if others don't object
Contributor
Author
|
Rebased on trunk. Dropped the test per @ayushtkn review. Ready for CI. Adding unit tests is generally a good idea. |
… during shutdown. Made-with: Cursor
df7c7f6 to
16f73a0
Compare
|
💔 -1 overall
This message was automatically generated. |
Member
|
My Bad I realise, there is already an older open PR for the ticket: #8200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NameNode.stop() called tracer.close() without a null check. If the NameNode is stopped before tracer is initialized (e.g. exception in parent constructor, or stopAtException() during failed startup), this caused an NPE at line 1116 and obscured the original failure.
Change
if (tracer != null)so shutdown completes without NPE when tracer was never set.JIRA
Fixes HDFS-17876