[GRADLE-3354] Continuous build's file watching keeps file locks on directories on Windows Created: 04/Nov/15  Updated: 04/Nov/15  Resolved: 04/Nov/15

Status: Resolved
Project: Gradle
Affects Version/s: 2.5, 2.8
Fix Version/s: 2.10-rc-1

Type: Bug
Reporter: Lari Hotari Assignee: Lari Hotari
Resolution: Fixed Votes: 0


 Description   

The JDK WatchService has problems on Windows related to file locks kept on watched directories.
https://bugs.openjdk.java.net/browse/JDK-7052697
https://bugs.openjdk.java.net/browse/JDK-6972833

The workaround is to use the FILE_TREE extension of WatchService which is only available on Windows. In this mode, the WatchService should only register the root directory of a file tree to the WatchService instead of registering each sub directory.

The assumption is also that using the FILE_TREE extension would make the JDK WatchService more reliable on Windows since some integration tests are occasionally failing in the CI environment because of lost file change events.



 Comments   
Comment by Lari Hotari [ 04/Nov/15 ]

Samples of CI test failures:
https://builds.gradle.org/viewLog.html?buildId=458751&tab=buildResultsDiv&buildTypeId=Gradle_Master_CoveragePhase_WindowsCoverage_WindowsJava18_2WindowsJava18&guest=1#testNameId8561987130845074706
https://builds.gradle.org/viewLog.html?buildId=458753&tab=buildResultsDiv&buildTypeId=Gradle_Master_CoveragePhase_WindowsCoverage_WindowsJava18_4WindowsJava18&guest=1#testNameId-182093995408249731

Comment by Lari Hotari [ 04/Nov/15 ]

Link to list of WatchService JDK bugs: https://bugs.openjdk.java.net/issues/?jql=project%20%3D%20JDK%20AND%20text%20~%20WatchService

Generated at Wed Jun 30 12:46:36 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.