RFR: 8297275: WatchService delay with PollingWatchService causes test failures

Tyler Steele tsteele at openjdk.org
Mon Nov 21 18:14:18 UTC 2022


On Sat, 19 Nov 2022 08:04:13 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> This minor change fixes a compliance test failure which was partially addressed by https://github.com/openjdk/jdk/commit/1bb4de2e2868a539846ec48dd43fd623c2ba69a5. However the failure was still observed on select machines. This change addresses the remaining failures by ensuring that any new WatchKey is held until the polling thread becomes active.
>
> This seems to adds a 1s sleep to Path.register. I don't think we want that. Would it be possible to start with a summary of the test failure that you are running into.

Hi @AlanBateman, thanks for your interest in the PR :slightly_smiling_face: 

> Would it be possible to start with a summary of the test failure that you are running into

The WatchService test I am debugging, creates a WatchKey and expects it to notice changes that the test makes to the file system. On AIX, this test is timing out after 10s without seeing the changes. My first PR to address this issue [1] changed the delay between when the polling thread is created, and when it begins polling for changes. That fix addressed the changes on IBM's internal servers. However, the issue still occurs on Adoptium servers.

The delay proposed by this PR, ensures that the WatchKey polling thread is active before returning the WatchKey via the register method. I agree that it's not really ideal to add a delay to the registration process, so other suggestions are welcome.

One alternative idea might be to simply lower the POLLING_INIT_DELAY to 0. 

[1] https://github.com/openjdk/jdk/pull/8479

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

PR: https://git.openjdk.org/jdk/pull/10824


More information about the nio-dev mailing list