JDK Bug# 8079620 (Watch Service Deadlock on OSX)

Vinay Purohit vp at cloudjunxion.com
Thu Aug 6 02:37:18 UTC 2015


Hello,

This is my first time posting on this forum.

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.

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.

The stack trace and other details are also posted on StackOverflow:

http://stackoverflow.com/questions/31780727/java-os-x-watchservice-deadlocks <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. 

Thank you,
Vinay Purohit
CloudJunxion, Inc.

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


More information about the nio-dev mailing list