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

Alan Bateman Alan.Bateman at oracle.com
Wed Jan 27 13:55:47 UTC 2016


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/

-Alan.


More information about the nio-dev mailing list