JDK Bug# 8079620 (Watch Service Deadlock on OSX)

Brian Burkhalter brian.burkhalter at oracle.com
Fri Aug 7 01:17:08 UTC 2015

Hello Vinay,

On Aug 5, 2015, at 7:37 PM, Vinay Purohit <vp at cloudjunxion.com> wrote:

> I’m writing to inquire about JDK Bug# 8079620 which appears to be very similar to the issue we are seeing. The resolution of that bug seems unclear.

It appears unclear to me as well and I have made an inquiry as to the reason for its current status.

> We see the problem with Java 8 (r45, might be in others as well, not sure) when using the Watch service on a Mac OS X platform. The service is being used for monitoring creation/deletion/modification of files under the folder registered with the Watch service. Unfortunately rapid creation/renaming of subfolders under the registered directory results in a hung thread. The stack trace is shown below:
> at sun.nio.fs.PollingWatchService$PollingWatchKey.disable(PollingWatchService.java:296)
> at sun.nio.fs.PollingWatchService.doPrivilegedRegister(PollingWatchService.java:169)
> at sun.nio.fs.PollingWatchService.access$000(PollingWatchService.java:45)
> at sun.nio.fs.PollingWatchService$2.run(PollingWatchService.java:128)
> at sun.nio.fs.PollingWatchService$2.run(PollingWatchService.java:125)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.nio.fs.PollingWatchService.register(PollingWatchService.java:124)
> at sun.nio.fs.UnixPath.register(UnixPath.java:897)
> at myClass.functionFoo (myClass:xyz)    <—— Invoke register() here.
This indeed looks like the same problem described in https://bugs.openjdk.java.net/browse/JDK-8079620. I have run the test provided in the description of that issue on Mac OS 10.9.5 using both the official build of JDK 8u40 and my development build of JDK 9. I was not able to reproduce the problem with either version but of course one test run is not a guarantee.

> The stack trace and other details are also posted on StackOverflow:
> http://stackoverflow.com/questions/31780727/java-os-x-watchservice-deadlocks
> I’m happy to provide more details or perform more experiments, but would first like to confirm I have reached the right forum for discussing this issue. 

This is the correct forum for java.nio issues.

It would be helpful if you were able to provide a standalone test case. It would be even better if you were to file an issue including the test case via this page: http://bugs.java.com/. This will ensure that the problem will be tracked and addressed in due course. This is especially important if the problem is not in fact a duplicate of JDK-8079620.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20150806/7594aedc/attachment.html>

More information about the nio-dev mailing list