You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2021/12/28 12:02:16 UTC
[Bug 65772] New: stop using file deleteOnExit in DefaultTempFileCreationStrategy
https://bz.apache.org/bugzilla/show_bug.cgi?id=65772
Bug ID: 65772
Summary: stop using file deleteOnExit in
DefaultTempFileCreationStrategy
Product: POI
Version: 5.0.x-dev
Hardware: PC
OS: Mac OS X 10.1
Status: NEW
Severity: normal
Priority: P2
Component: POI Overall
Assignee: dev@poi.apache.org
Reporter: fanningpj@yahoo.com
Target Milestone: ---
https://rules.sonarsource.com/java/RSPEC-2308
It uses up memory to track the files and it only removes them on tidy shutdown.
It would be better to fix the code to remove temp files as we go - as soon as
they are no longer needed.
DefaultTempFileCreationStrategy has support for -Dpoi.keep.tmp.files - I'm
going to flip the logic and replace this with -Dpoi.delete.tmp.files.on.exit
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 65772] stop using file deleteOnExit in DefaultTempFileCreationStrategy
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65772
PJ Fanning <fa...@yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS|Mac OS X 10.1 |All
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 65772] stop using file deleteOnExit in DefaultTempFileCreationStrategy
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65772
PJ Fanning <fa...@yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 65772] stop using file deleteOnExit in DefaultTempFileCreationStrategy
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65772
--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
main change is r1896473
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 65772] stop using file deleteOnExit in DefaultTempFileCreationStrategy
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65772
--- Comment #5 from Andreas Capellmann <a....@diskover.de> ---
Thank you for your quick response. I was looking at the most recent version of
the code, i.e. Commit d034f95, but I mixed up the last line number. Well, as
you say: Let's not talk about line numbers.
In the class level Javadoc there is written "Files are collected into one
directory and by default are deleted on exit from the VM." The second part is
not true anymore since your last change. Now they are kept by default! This is
because the "deleteOnExit" flag is only set, if the system property
poi.delete.tmp.files.on.exit is defined. In a default environment it is not set
and so by default the temp files are not deleted but kept.
Also in the class level Javadoc it says "Files can be kept by defining the
system property {@link #DELETE_FILES_ON_EXIT}." This is also an old text and
now wrong. If you set this system property, files are not kept, but deleted.
At last the inline comment in method createTempFile, which says "Set the delete
on exit flag, but only when explicitly disabled". This is kind of misleading.
What the code does is "Set the delete on exit flag, but only if enabled by
defining the system property {@link #DELETE_FILES_ON_EXIT}."
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 65772] stop using file deleteOnExit in DefaultTempFileCreationStrategy
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65772
--- Comment #3 from PJ Fanning <fa...@yahoo.com> ---
Hi Andreas - I reviewed the code and javadoc and it seems correct to me. There
is no point using line numbers - you could be talking about about release of
the code. The numbers you provided don't seem to match the latest code.
Provide a PR if you think the javadoc is wrong.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 65772] stop using file deleteOnExit in DefaultTempFileCreationStrategy
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65772
--- Comment #4 from PJ Fanning <fa...@yahoo.com> ---
typo: `about about release` - I meant `about any release`
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 65772] stop using file deleteOnExit in DefaultTempFileCreationStrategy
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65772
Andreas Capellmann <a....@diskover.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |a.capellmann@diskover.de
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 65772] stop using file deleteOnExit in DefaultTempFileCreationStrategy
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65772
--- Comment #2 from Andreas Capellmann <a....@diskover.de> ---
@pjfanning, unfortunately, due to your change, now disk space is running out on
our clients' server machines, if they do a lot of Excel exporting. After
understanding your change, we can easily handle that, but it was quite a
search. We relied on the Javadoc of class "DefaultTempFileCreationStrategy",
which still says, that by default temp files are deleted on exit. Can you
please review and adjust the Javadocs in lines 33 and 35 and also the inline
comment in method "createTempFile" in line 104? Thanks for all your work on the
POI project!
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 65772] stop using file deleteOnExit in DefaultTempFileCreationStrategy
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65772
--- Comment #6 from Dominik Stadler <do...@gmx.at> ---
At least 5.3.0 should remove temporary files created by SXSSFWorkbook if the
workbook is properly closed. It seems version 5.2.0 - 5.2.5 did not handle this
properly.
Please report a new issue with details for reproducing if there are cases on
5.3.0+ which lead to left-over files which are not solved by calling "close()"
or "dispose()" as intended.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org