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

Dinesh Chitlangia edited comment on HDDS-849 at 11/19/18 3:30 PM:
------------------------------------------------------------------

[~msingh] Thank you for filing this issue. Attached patch 001 with proposed fix.

The reason for the failure was since we are using mockito we are defining when 
to call real method and when to mock the objects, however, for audit related 
methods in HddsDispatcher( buildAuditMessageForSuccess & 
buildAuditMessageForFailure), no rules were defined and thus the message was 
returned as null causing the NPE.


was (Author: dineshchitlangia):
[~msingh] Thank you for filing this issue. Attached patch 001 with proposed fix.

> fix NPE in TestKeyValueHandler because of audit log write
> ---------------------------------------------------------
>
>                 Key: HDDS-849
>                 URL: https://issues.apache.org/jira/browse/HDDS-849
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 0.4.0
>            Reporter: Mukul Kumar Singh
>            Assignee: Dinesh Chitlangia
>            Priority: Major
>             Fix For: 0.4.0
>
>         Attachments: HDDS-849.001.patch
>
>
> TestKeyValueHandler#testCloseInvalidContainer and 
> TestKeyValueHandler#testHandlerCommandHandling are failing because of the 
> following exception.
> {code}
> [ERROR] 
> testCloseInvalidContainer(org.apache.hadoop.ozone.container.keyvalue.TestKeyValueHandler)
>   Time elapsed: 0.006 s  <<< ERROR!
> java.lang.NullPointerException
>       at 
> org.apache.hadoop.ozone.audit.AuditLogger.logWriteFailure(AuditLogger.java:64)
>       at 
> org.apache.hadoop.ozone.container.common.impl.HddsDispatcher.audit(HddsDispatcher.java:433)
>       at 
> org.apache.hadoop.ozone.container.common.impl.HddsDispatcher.dispatch(HddsDispatcher.java:242)
>       at 
> org.apache.hadoop.ozone.container.keyvalue.TestKeyValueHandler.testCloseInvalidContainer(TestKeyValueHandler.java:282)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
>       at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>       at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
>       at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>       at 
> org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
> {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