[crac] RFR: Linux file system watcher support [v4]
Anton Kozlov
akozlov at openjdk.org
Fri Jun 9 12:05:13 UTC 2023
On Thu, 25 May 2023 09:26:01 GMT, joeylee <duke at openjdk.org> wrote:
>> inotify monitors changes on filesystem, this support automatic restore for LinuxFileWatcher.
>>
>> FileWatcherAfterRestoreTest verifies watcher service works after restore.
>> FileWatcherTest verifies automatic closing inotiify fd
>>
>> The watcher keys are still managed by user, so exception will be thrown if no watcher keys are leaked, as in FileWatcherWithOpenKeysTest
>
> joeylee has updated the pull request incrementally with one additional commit since the last revision:
>
> update
Changes requested by akozlov (Lead).
src/java.base/linux/classes/sun/nio/fs/LinuxWatchService.java line 219:
> 217: CheckpointRestoreState thisState;
> 218: if (wdToKey.size() == 0) {
> 219: unsafe.freeMemory(address);
Although wait, where is the address is reinitialized? That is created in the constructor, and initFDs() reinitializes only file descriptors. This is very likely to be the reason behind those crashes, I can reproduce one locally.
I don't see any reasons to free the memory, it can perfectly be saved to the image. After removing this line, the test has passed 10 of 10 local runs.
-------------
PR Review: https://git.openjdk.org/crac/pull/72#pullrequestreview-1471837213
PR Review Comment: https://git.openjdk.org/crac/pull/72#discussion_r1224214828
More information about the crac-dev
mailing list