RFR: 8359477: com/sun/net/httpserver/Test12.java appears to have a temp file race [v3]
Daniel Fuchs
dfuchs at openjdk.org
Mon Jun 16 11:31:32 UTC 2025
On Mon, 16 Jun 2025 10:23:25 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> Thanks, now I see. Those resource usages in `FileServerHandler` should ideally be wrapped in try-with-resources, but that is out of the scope of this work.
>
>> Those resource usages in FileServerHandler should ideally be wrapped in try-with-resources, but that is out of the scope of this work.
>
> Agreed and I've put it in my TODO list. That won't fix this current issue though (I think you understand that, but just stating here for the sake of completeness).
I believe that Volkan has a point - provided that FileServerHandler always eventually closes the file.
Each new request will be submitted to the executor by the HttpServer, therefore waiting for the executor to finish should ensure that FileServerHandler::handle has finished, and therefore that the the file has been closed.
Provided there's no rogue connection to the server...
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25820#discussion_r2149713777
More information about the net-dev
mailing list