8148192: (fs) Path.register can fail with Bad file descriptor and other errors

Chris Hegarty chris.hegarty at oracle.com
Thu Jan 28 12:46:57 UTC 2016


On 27 Jan 2016, at 13:55, Alan Bateman <Alan.Bateman at oracle.com> wrote:

> 
> We have a bug in one of the base classes for the native WatchService implementations whereby updating a registration will fail with an IOException rather than a ClosedWatchServiceException when invoked at around the time that the WatchService is asynchronously closed.
> 
> The change is trivial and has two parts:
> 
> (a) insures that the wakeup is done while holding the requestList lock. I don't know this was missed originally.
> 
> (b) in the poller thread (the thread that polls the native facility) queues the CloseWatchServiceException and then processes the update when it should never do both.
> 
> The test in the webrev reproduces the issues on all platforms with native implementations.
> 
> http://cr.openjdk.java.net/~alanb/8148192/webrev/

This looks fine Alan.

Trivially, should the test use the test library RandomFactory, or maybe the usage
is too trivial?

-Chris


More information about the nio-dev mailing list