[
https://issues.apache.org/jira/browse/HDFS-17108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17765309#comment-17765309
]
ASF GitHub Bot commented on HDFS-17108:
---------------------------------------
teamconfx opened a new pull request, #6078:
URL: https://github.com/apache/hadoop/pull/6078
### Description of PR
https://issues.apache.org/jira/browse/HDFS-17108
This PR adds a check for `filesys` not `null` and file exists before
cleaning up in `finally` clause.
### How was this patch tested?
1. Set `dfs.client.read.shortcircuit=true`
2. Run
`org.apache.hadoop.hdfs.TestDecommissionWithBackoffMonitor#testNodeUsageWhileDecommissioining`
### 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?
> Null Pointer Exception when running TestDecommissionWithBackoffMonitor
> ----------------------------------------------------------------------
>
> Key: HDFS-17108
> URL: https://issues.apache.org/jira/browse/HDFS-17108
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: ConfX
> Priority: Critical
> Attachments: reproduce.sh
>
>
> h2. What happened
> After setting {{{}dfs.client.read.shortcircuit=true{}}}, running test
> {{org.apache.hadoop.hdfs.TestDecommissionWithBackoffMonitor#testNodeUsageWhileDecommissioining}}
> results in a {{{}NullPointerException{}}}.
> h2. Where's the bug
> In the test class {{{}org.apache.hadoop.hdfs.TestDecommission{}}}:
> {noformat}
> } finally {
> cleanupFile(fileSys, file1);
> }{noformat}
> However, the class does not check if the fileSys is null, causing the NPE.
> h2. How to reproduce
> # Set {{dfs.client.read.shortcircuit=true}}
> # Run
> {{org.apache.hadoop.hdfs.TestDecommissionWithBackoffMonitor#testNodeUsageWhileDecommissioining}}
> and the following exception should be observed:
> {noformat}
> java.lang.NullPointerException
> at
> org.apache.hadoop.hdfs.AdminStatesBaseTest.cleanupFile(AdminStatesBaseTest.java:459)
> at
> org.apache.hadoop.hdfs.TestDecommission.nodeUsageVerification(TestDecommission.java:1575)
> at
> org.apache.hadoop.hdfs.TestDecommission.testNodeUsageWhileDecommissioining(TestDecommission.java:1510){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: [email protected]
For additional commands, e-mail: [email protected]