PollingWatchService possible issue
brian.burkhalter at oracle.com
Sat Dec 10 01:15:46 UTC 2016
This topic should be discussed on the nio-dev mailing list so I am re-directing the thread there. Please omit core-libs-dev from any replies, thanks.
On Dec 4, 2016, at 12:50 PM, Alan Snyder <fishgarage at cbfiddle.com> wrote:
> I notice that PollingWatchService never checks the file key when it reads a directory to see if it is reading from the same directory that it started with.
To clarify, do you intend that this check should be prior to the creation of the DirectoryStream at ?
> I suspect that creates a potential for incorrect behavior if the directory tree is rearranged (between polls) so that the original path accesses a different directory.
> Specifically, if the original directory remains available via some other path, then someone watching on that path or trying to register using that path will be using a watch service that is reading the wrong directory.
This does seem like a potential problem.
More information about the core-libs-dev