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

Alan Bateman Alan.Bateman at oracle.com
Fri Apr 12 17:49:05 UTC 2024



On 12/04/2024 18:42, Bruno Ploumhans wrote:
> Hi,
>
> When reading from a zip file on the disk, ZipFileSystem uses a 
> SeekableByteChannel internally to read from the zip file. 
> Unfortunately, this channel is interruptible, and therefore a single 
> thread interruption while reading from a ZipPath will make the entire 
> ZipFS unusable. This is problematic for long-lived ZipFileSystems that 
> can be used by multiple threads. I suppose that this is a bug?

There are a couple of issues on this, JDK-8316882 [1]. We had proposals 
in the past to allow a FileChannel be created as "uninterruptible" but 
there wasn't consensus on moving forward on that.

-Alan

[1] https://bugs.openjdk.org/browse/JDK-8316882
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/nio-dev/attachments/20240412/22939c2e/attachment-0001.htm>


More information about the nio-dev mailing list