RFR: 8276994: java/nio/channels/Channels/TransferTo.java leaves multi-GB files in /tmp
Markus KARG
duke at openjdk.java.net
Sun Nov 14 17:03:39 UTC 2021
On Sun, 14 Nov 2021 15:08:35 GMT, Lance Andersen <lancea at openjdk.org> wrote:
>> As all the *other* tests in this test class run rather quick (within seconds) I wonder what you expect to *actually* gain? The difference would just be some seconds of earlier deletion for the sake of worse readability, actually. If the majority is for keeping your original solution, this is fine for me. I just like to understand the driver behind this.
>
> In the unlikely event there is an error, we can uniquely identify which file is left around more easily. Your proposed change ignores the IOException completely.
>
> Given the size of the files, best to clean up before existing the test method.
What should it be good for knowing which test left behind the temp file? As the code is not incorrect, you always would just delete *all* temp files of this test anyways - whether they are from the 2GB test or not. So this information helps you exactly nothing.
Your original code also ignored the IOException completely, so I do not understand that argument.
I do not see *any* benefit from immediate deletion vs deletion after ten seconds.
Those arguments are rather academic. I miss *real* benefit, actually.
>> Yes I could do that but I think it is better to understand for the reader as it clearly explains that this code is part of the test management, not part of the test logic.
>
> This is a simple test so really no need not do the initialization as part of the declaration given there is no other work done by this method.
As I explained, this is not written due to a *need* but due to *deliberate separation of concerns*. So is separation of concerns a design strategy that is forbidden in OpenJDK?
-------------
PR: https://git.openjdk.java.net/jdk/pull/6379
More information about the nio-dev
mailing list