FrankinRUC opened a new pull request #3431:
URL: https://github.com/apache/hadoop/pull/3431
<!--
Thanks for sending a pull request!
1. If this is your first time, please read our contributor guidelines:
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
2. Make sure your PR title starts with JIRA issue id, e.g.,
'HADOOP-17799. Your PR title ...'.
-->
### Description of PR
As discussed in HADOOP-6536, FileUtil#fullyDelete should not delete the
contents of the sym-linked directory when we pass a symlink parameter.
Currently we try to delete the resource first by calling deleteImpl, and if
deleteImpl is failed, we regard it as non-empty directory and remove all its
contents and then itself. This logic behaves wrong when local file system
cannot delete symlink to a directory because of faulty disk, local system's
error, etc. When we cannot delete it in the first time, hadoop will try to
remove all the contents of the directory it pointed to and leave an empty dir.
So, we should add an isSymlink checking before we call fullyDeleteContents
to prevent such behavior.
### How was this patch tested?
### 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?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]