RFR: 8288627: [AIX] Implement WatchService using system library
Tyler Steele
tsteele at openjdk.org
Tue Jun 28 13:18:26 UTC 2022
On Fri, 24 Jun 2022 17:36:57 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> This PR begins an effort to re-implement the WatchService API on AIX using 'AIX Event Infrastructure' (AHAFS). The initial motivation for doing so was to address errors found by some internal testing in the implementation based on PollingWatchService.java.
>>
>> I am submitting these changes before they are fully complete because (1) it represents a fairly large change that mostly works well, and could easily be improved upon in the future; (2) to get some early feedback on the changes so the final review process is quicker. My expected plan is to merge these changes after review, add any remaining test failures to a problem list, and return to them soon.
>>
>> ### Testing
>> I am waiting for confirmation that this re-implementation passes the internal tests we saw failing. Initial results look promising. In addition, I see the following failing tests from `test/jdk/java/nio/file/WatchService`:
>>
>> - Basic.java fails at testTwoWatchers. Having two WatchService instances registered with the same file, will require some additional work to be supported with AHAFS. This is currently a limitation of this implementation.
>> - DeleteInterference.java fails for the same reason as above.
>> - UpdateInterference.java fails for no good reason that I can deduce. Logging the test's progress shows that it doesn't seem to leave [the main loop](https://github.com/openjdk/jdk/blob/master/test/jdk/java/nio/file/WatchService/UpdateInterference.java#L97-L111), but that it makes is to within 1ms of doing so.
>
> test/jdk/java/nio/file/WatchService/Basic.java line 77:
>
>> 75: if (!expectedContext.equals(event.context())) {
>> 76: System.out.format("context: %s (%s) | expected: %s (%s)", event.context(), event.context().getClass(), expectedContext, expectedContext.getClass());
>> 77: throw new RuntimeException("unexpected context: " + event.context() +
>
> If you are changing the test then please try to keep it consistent with the existing code if possible. In this case, adding a 150+ line is a bit annoying as it will mess up all future side-by-side diffs.
Fair comment. Though, I actually wasn't looking to change the test, I just overlooked this when I removed some changes I had made to help me debug an issue. I have now reverted this change to the test as well.
-------------
PR: https://git.openjdk.org/jdk/pull/9281
More information about the nio-dev
mailing list