[IO-874] FileUtils.forceDelete can delete a broken symlink again#756
Merged
garydgregory merged 2 commits intoapache:masterfrom Jul 1, 2025
Merged
Conversation
asf-gitbox-commits
pushed a commit
that referenced
this pull request
Jul 1, 2025
Member
|
Merged. Ty @JoergBudi ! |
asf-gitbox-commits
pushed a commit
that referenced
this pull request
Jul 1, 2025
dongjoon-hyun
added a commit
to apache/spark
that referenced
this pull request
Jul 30, 2025
### What changes were proposed in this pull request? This PR aims to upgrade `commons-io` to 2.20.0 for Apache Spark 4.1.0. ### Why are the changes needed? To bring the latest bug fixes. - https://commons.apache.org/proper/commons-io/changes.html#a2.20.0 (2025-07-13) - apache/commons-io#756 ### Does this PR introduce _any_ user-facing change? No behavior change. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #51730 from dongjoon-hyun/SPARK-53024. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fix for https://issues.apache.org/jira/browse/IO-859 introduced this regression bug https://issues.apache.org/jira/browse/IO-874, which is triggered when a broken/dangling symlink is tried to be deleted.
Before 2.16.1, FileUtils.forceDelete() deleted broken/dangling symbolic links successfully, since then it throws FileNotFoundException. With this fix a FileNotFoundException is only thrown, when the target file does not exist AND is not a symlink. 2 tests have been added to check that a broken link is deleted and that an ok link only deletes the link but not the file itself (increase test coverage).
Note: This is my first contribution. I just signed the ICLA as JoergBudi@gmx.de, shared it with secretary@apache.org and got a receipt, but haven't got an apacheid yet (my preferred apacheid would be jbudi , but I am in no hurry in case that is handed out only after more contribs).