Fwd: Thread interruption while reading from a ZipFS entry will close the entire FS

Alan Bateman Alan.Bateman at oracle.com
Sun Apr 14 06:16:29 UTC 2024


On 13/04/2024 17:09, Bruno Ploumhans wrote:
> If there is a well-specified API for uninterruptible channels, it
> might be worth moving the logic for `beginBlocking` and `endBlocking`
> to `AbstractInterruptibleChannel`.

I don't think that would make sense. The reason the thread has been 
interrupted is because something wants to cancel what it are doing as 
quickly as possible. It's important that operations on network channels 
that block indefinitely are interruptible. The discussion is focused on 
FileChannel as it is somewhat questionable whether it should have been 
an InterruptibleChannel in the first place. It's not always feasible, 
plus you get into issues where a FileChannel is part of low level 
infrastructure and used by concurrent threads accessing different parts 
of the file. Also when wrapped as InputStream/OutputStream then the 
result I/O streams are interruptible which can be surprising.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/nio-dev/attachments/20240414/23c41578/attachment.htm>


More information about the nio-dev mailing list