RFR JDK-8069211: (zipfs) ZipFileSystem creates corrupted zip if entry output stream gets closed more than once
Xueming Shen
xueming.shen at oracle.com
Tue Jan 20 20:13:25 UTC 2015
Hi,
Here is the webrev that now synchronizes the write and close methods to
guarantee we have a correct zip entry even when the output stream is
accessed by multiple threads.
http://cr.openjdk.java.net/~sherman/8069211
-Sherman
On 01/16/2015 11:36 PM, Alan Bateman wrote:
> On 16/01/2015 21:00, Xueming Shen wrote:
>> Yes, not only the zipfs. lots of the streams from the j.u.zip pacakge are not "thread safe". We probably
>> need take a look later. It really does not make lots of sense to share an io stream among multiple threads
>> though.
> I wasn't suggesting it would be make sense to have multiple threads writing to the same output stream, rather it's the async close of the FileSystem that I was wondering about as this should really synchronize with any readers/writers to allow all open resources to be closed before closing the FileSystem.
>
> -Alan
More information about the nio-dev
mailing list