[ 
https://issues.apache.org/jira/browse/HDDS-354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16591229#comment-16591229
 ] 

Dinesh Chitlangia edited comment on HDDS-354 at 8/24/18 6:58 AM:
-----------------------------------------------------------------

[~ajayydv] - Would you be able to share steps to repro?

I investigated VolumeInfo and VolumeUsage classes. I suspect we have a bigger 
problem that has somehow managed to sneak :)

Clearly the VolumeUsage instance was null and led to this issue.

Quick fix - 
{quote}{{public long getScmUsed() throws IOException {}}
 if(usage != null)
 {{ return usage.getScmUsed();}}
 } else {
 {{ return 0L;}}
 }
 {{}}}
{quote}
However, I think we must investigate and address why VolumeUsage instance was 
null.

This can affect VolumeInfo#getCapacity() and VolumeInfo#getAvailable() too.

 

Alternate: We must check if usage is null log an ERROR after this line:

{{this.usage = new VolumeUsage(root, b.conf);}}


was (Author: dineshchitlangia):
[~ajayydv] - Would you be able to share steps to repro?

I investigated VolumeInfo and VolumeUsage classes. I suspect we have a bigger 
problem that has somehow managed to sneak :)

Clearly the VolumeUsage instance was null and led to this issue.

Quick fix - 

{{public long getScmUsed() throws IOException {}}
{{ if(usage != null){}}
{{ return usage.getScmUsed();}}
{{ } else {}}
{{ return 0L;}}
{{ }}}
{{}}}

However, I think we must investigate and address why VolumeUsage instance was 
null.

This can affect VolumeInfo#getCapacity() and VolumeInfo#getAvailable() too.

 

Alternate: We must check if usage is null log an ERROR after this line:

{{this.usage = new VolumeUsage(root, b.conf);}}

> VolumeInfo.getScmUsed throws NPE
> --------------------------------
>
>                 Key: HDDS-354
>                 URL: https://issues.apache.org/jira/browse/HDDS-354
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>            Reporter: Ajay Kumar
>            Priority: Major
>
> {code}java.lang.NullPointerException
>       at 
> org.apache.hadoop.ozone.container.common.volume.VolumeInfo.getScmUsed(VolumeInfo.java:107)
>       at 
> org.apache.hadoop.ozone.container.common.volume.VolumeSet.getNodeReport(VolumeSet.java:366)
>       at 
> org.apache.hadoop.ozone.container.ozoneimpl.OzoneContainer.getNodeReport(OzoneContainer.java:264)
>       at 
> org.apache.hadoop.ozone.container.common.report.NodeReportPublisher.getReport(NodeReportPublisher.java:64)
>       at 
> org.apache.hadoop.ozone.container.common.report.NodeReportPublisher.getReport(NodeReportPublisher.java:39)
>       at 
> org.apache.hadoop.ozone.container.common.report.ReportPublisher.publishReport(ReportPublisher.java:86)
>       at 
> org.apache.hadoop.ozone.container.common.report.ReportPublisher.run(ReportPublisher.java:73)
>       at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>       at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
>       at java.util.concurrent.FutureTask.run(FutureTask.java)
>       at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
>       at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>       at java.lang.Thread.run(Thread.java:745){code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to