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

ASF GitHub Bot commented on HDFS-17103:
---------------------------------------

teamconfx opened a new pull request, #6071:
URL: https://github.com/apache/hadoop/pull/6071

   ### Description of PR
   https://issues.apache.org/jira/browse/HDFS-17103
   This PR adds a null check for `fileSys` and `cluster` during test cleanup.
   
   ### How was this patch tested?
   (1) Set `dfs.namenode.maintenance.replication.min` to `-1155969698`
   (2) Run test: 
`org.apache.hadoop.hdfs.server.namenode.TestNameEditsConfigs#testNameEditsConfigsFailure`
   The test now shows the actual exception rather than the 
`NullPointerException`.
   
   ### For code changes:
   
   - [x] Does the title or this PR starts with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: have the integration tests been executed and the 
endpoint declared according to the connector-specific documentation?
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, 
`NOTICE-binary` files?
   
   




> messy file system cleanup in TestNameEditsConfigs
> -------------------------------------------------
>
>                 Key: HDFS-17103
>                 URL: https://issues.apache.org/jira/browse/HDFS-17103
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: ConfX
>            Priority: Critical
>         Attachments: reproduce.sh
>
>
> h2. What happened:
> Got a {{NullPointerException}} without message when running 
> {{{}TestNameEditsConfigs{}}}.
> h2. Where's the bug:
> In line 450 of {{{}TestNameEditsConfigs{}}}, the test attempts to cleanup the 
> file system:
>  
> {noformat}
>       ...
>       fileSys = cluster.getFileSystem();
>       ...
>     } finally  {
>       fileSys.close();
>       cluster.shutdown();
>     }{noformat}
> However, the cleanup would result in a {{NullPointerException}} that covers 
> up the actual exception if the initialization of {{fileSys}} fails or another 
> exception is thrown before the line that initializes {{{}fileSys{}}}.
> h2. How to reproduce:
> (1) Set {{dfs.namenode.maintenance.replication.min}} to {{-1155969698}}
> (2) Run test: 
> {{org.apache.hadoop.hdfs.server.namenode.TestNameEditsConfigs#testNameEditsConfigsFailure}}
> h2. Stacktrace:
> {noformat}
> java.lang.NullPointerException,
>         at 
> org.apache.hadoop.hdfs.server.namenode.TestNameEditsConfigs.testNameEditsConfigsFailure(TestNameEditsConfigs.java:450),{noformat}
> For an easy reproduction, run the reproduce.sh in the attachment.
> We are happy to provide a patch if this issue is confirmed.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to