You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "sumitagrawl (via GitHub)" <gi...@apache.org> on 2023/03/12 05:38:51 UTC

[GitHub] [ozone] sumitagrawl commented on a diff in pull request #4340: HDDS-8054. NullPointerException: MethodMetric, Error invoking method getReserved.

sumitagrawl commented on code in PR #4340:
URL: https://github.com/apache/ozone/pull/4340#discussion_r1133190314


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/VolumeInfoMetrics.java:
##########
@@ -104,23 +104,26 @@ public String getMetricsSourceName() {
    */
   @Metric("Returns the Used space")
   public long getUsed() {
-    return volume.getVolumeInfo().getScmUsed();
+    return volume.getVolumeInfo() != null ?

Review Comment:
   getVolumeInfo() is used multiple places and its null if failedVolume. So need to have null check of isFailed check wherever this is called.
   Similarly need fix for refreshVolumeInfo() also



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org