Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-empty dctemp directory does not get deleted #6374

Closed
sellersj opened this issue Jan 9, 2024 · 2 comments
Closed

non-empty dctemp directory does not get deleted #6374

sellersj opened this issue Jan 9, 2024 · 2 comments
Labels

Comments

@sellersj
Copy link
Contributor

sellersj commented Jan 9, 2024

Describe the bug
Pretty sure that the change from moving from commons-io to pure java made it so the temp directories do not get deleted in FileUtils.delete(file)
https://github.com/jeremylong/DependencyCheck/pull/6343/files#diff-85b91249daadcc4a913e9b171dc8095e85c76e359d182046f8df56220df78278
This cause out an out disk space on my build box where I had 100-250 GB of free space. Each maven module creates about 135 MB of space.

Version of dependency-check used
The problem occurs using version 9.0.8 of the maven plugin. The issue did not exist in 9.0.7

Log file
When reporting errors, 99% of the time log file output is required. Please post the log file as a gist and provide a link in the new issue.
n/a in this case I think

To Reproduce
Steps to reproduce the behavior:

  1. Run a build with the maven plugin
  2. Go to the temp directory
  3. See it filled with folders that start with "dctemp"

Expected behavior
That the temp files are correctly cleared out

Additional context
n/a

@sellersj sellersj added the bug label Jan 9, 2024
@sellersj
Copy link
Contributor Author

sellersj commented Jan 9, 2024

I rolled back the change. The temp space had taken up about 160G of space.

I think that the fix would be change the delete call to something like this

Files.walk(file.toPath())
  .sorted(Comparator.reverseOrder())
  .map(Path::toFile)
  .forEach(File::delete);

@sellersj
Copy link
Contributor Author

sellersj commented Jan 9, 2024

I tested 9.0.9-SNAPSHOT with a couple of hundred projects on a CI server and the disk usage didn't change much.

I can't tie this issue to a milestone, but that's where it was fixed.

Closing ticket.

@sellersj sellersj closed this as completed Jan 9, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant