RFR: 8285956: (fs) Excessive default poll interval in PollingWatchService [v6]

Tyler Steele duke at openjdk.java.net
Tue May 3 13:56:49 UTC 2022


> PollingWatchService.java contains the WatchService and WatchKey implementation for AIX and BSD. When a Path is [register](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/file/Path.html#register(java.nio.file.WatchService,java.nio.file.WatchEvent.Kind...))ed this implementation creates a  polling thread to monitor for file system changes. Currently, this thread waits 10 seconds before it's first poll, and then waits 10 seconds between subsequent polls. This interval leads to sluggish performance.
> 
> This PR makes the following changes:
> - Sets the initial interval to 1 second regardless of the period.
> - Change the default period to 1 second.
> 
> All tests in `test/jdk/java/nio/file/WatchService` passing.

Tyler Steele has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:

  Change default polling interval 1 -> 2

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8479/files
  - new: https://git.openjdk.java.net/jdk/pull/8479/files/696e1ee5..65eb8f12

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8479&range=05
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8479&range=04-05

  Stats: 11 lines in 1 file changed: 5 ins; 6 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8479.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8479/head:pull/8479

PR: https://git.openjdk.java.net/jdk/pull/8479


More information about the nio-dev mailing list