7164570: (fs) WatchService queues CREATE event but not DELETE event for very short lived files [sol11]

Alan Bateman Alan.Bateman at oracle.com
Tue May 1 06:50:10 PDT 2012


On 01/05/2012 14:18, Vitaly Davidovich wrote:
>
> Hi Alan,
>
> registerChildren() swallows IOException and 
> DirectoryIteratorException.  Does this mean caller may think that 
> events got registered but in fact it didn't? Would it be better if 
> these exceptions were propagated to the caller?
>
If the directory can't be registered then the IOException is propagated, 
you need to look at implRegister to see the details.

The code in this patch is the code for scanning of the directory that is 
done after the directory is initially registered or after we are 
notified that the directory has changed, usually because of new files 
being created. This all happens in the background poller thread that is 
servicing the event port so it's not always possible to propagate errors 
(the swallowing of exceptions that you see has always been there). 
However as you bring this up, then we could potentially queue an 
OVERFLOW event. That would at least cause the user of the API to re-scan 
and synchronize its view of the directory.

-Alan.


More information about the nio-dev mailing list