Integrated: 8285956: (fs) Excessive default poll interval in PollingWatchService

Tyler Steele duke at openjdk.java.net
Thu May 5 04:08:26 UTC 2022


On Sat, 30 Apr 2022 00:14:29 GMT, Tyler Steele <duke at openjdk.java.net> wrote:

> 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.

This pull request has now been integrated.

Changeset: 1bb4de2e
Author:    Tyler Steele <tyler.steele at ibm.com>
Committer: Thomas Stuefe <stuefe at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/1bb4de2e2868a539846ec48dd43fd623c2ba69a5
Stats:     9 lines in 1 file changed: 6 ins; 0 del; 3 mod

8285956: (fs) Excessive default poll interval in PollingWatchService

Reviewed-by: stuefe, bpb

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

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


More information about the nio-dev mailing list