6979009: (fc) FileChannel.read() fails to throw ClosedByInterruptException
Alan Bateman
Alan.Bateman at oracle.com
Sun Nov 7 04:14:33 PST 2010
I've been talking to Dag Wanvik (Derby/Java DB project) about some
issues that they are seeing when threads doing I/O with a FileChannel
are interrupted. They periodically see the channel being "silently
closed" and also spurious ClosedByInterruptExceptions thrown by other
threads doing I/O that are not interrupted. As it turns out there is a
small rat's nest that has always been there. The following changes fix
these issues so that ClosedByInterruptException is consistently thrown,
and only by the thread that is interrupted. We may need to follow this
up with a spec clarification for the case that a thread is interrupted
at just around the time that an I/O completes.
http://cr.openjdk.java.net/~alanb/6979009/webrev/
Thanks,
Alan.
More information about the nio-dev
mailing list