[
https://issues.apache.org/jira/browse/HDFS-17107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18029927#comment-18029927
]
ASF GitHub Bot commented on HDFS-17107:
---------------------------------------
github-actions[bot] closed pull request #6033: HDFS-17107. Null Pointer
Exception after turned on detail metric for namenode lock
URL: https://github.com/apache/hadoop/pull/6033
> Null Pointer Exception after turned on detail metric for namenode lock
> ----------------------------------------------------------------------
>
> Key: HDFS-17107
> URL: https://issues.apache.org/jira/browse/HDFS-17107
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: ConfX
> Priority: Critical
> Labels: pull-request-available
> Attachments: reproduce.sh
>
>
> h2. What happened
> After setting {{{}dfs.namenode.lock.detailed-metrics.enabled=true{}}},
> running test
> {{org.apache.hadoop.hdfs.server.namenode.TestFSNamesystemLock#testFSWriteLockReportSuppressed}}
> results in a {{{}NullPointerException{}}}.
> h2. Where's the bug
> In class {{{}FSNameSystemLock{}}}:
> {noformat}
> if (metricsEnabled) {
> String opMetric = getMetricName(operationName, isWrite);
> detailedHoldTimeMetrics.add(opMetric, value);{noformat}
> here it may be that the metric is enabled but the detailedHoldTimeMetrics is
> null.
> h2. How to reproduce
> # Set {{dfs.namenode.lock.detailed-metrics.enabled=true}}
> # Run
> {{org.apache.hadoop.hdfs.server.namenode.TestFSNamesystemLock#testFSWriteLockReportSuppressed}}
> and the following exception should be observed:
> {noformat}
> java.lang.NullPointerException
> at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystemLock.addMetric(FSNamesystemLock.java:359)
> at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystemLock.writeUnlock(FSNamesystemLock.java:287)
> at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystemLock.writeUnlock(FSNamesystemLock.java:236)
> at
> org.apache.hadoop.hdfs.server.namenode.TestFSNamesystemLock.testFSWriteLockReportSuppressed(TestFSNamesystemLock.java:433){noformat}
> For an easy reproduction, run the reproduce.sh in the attachment.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]