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
Temporary files not cleaned up after Maven plugin execution #22112
Conversation
Thanks for the PR, @dreis2211. Ideally, I'd like a solution that can be tested but that's not easy to do with |
@wilkinsona I actually share the testability concern, I had this too while developing. |
It would certainly be nice to get a fix in some form or other into 2.3.2. I've labelled #22108 for team attention so we'll hopefully discuss it later today. Let's see what comes out of that and then make a decision on the best way to proceed. |
Sounds reasonable. Thanks |
We discussed this today and decided that we should merge this in 2.3.x and also bump up the threshold to reduce the number of files written. We'll perhaps try to look at refactoring that |
Thanks again, @dreis2211! |
Hi,
this PR fixes #22108 by calling
deleteOnExit
on the temporary file and additionally prevents creating the file all together if we don't exceed the thresholds for which it was introduced.Since
deleteOnExit
is only executed on "normal" VM termination, there is still a slight chance that temporary files will not be cleaned up when the VM dies for unknown reasons. But with the additional lazy init they probably won't be created in the first place for most apps.Let me know what you think.
Cheers,
Christoph