[crac] RFR: Handle open file descriptors with configurable policies [v3]

Radim Vansa duke at openjdk.org
Fri Jun 9 09:59:15 UTC 2023

On Thu, 8 Jun 2023 18:05:01 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
>>   Effectively revert previous commit: Initialize logger in <clinit>
> src/java.base/share/classes/java/io/FileDescriptor.java line 67:
>> 65:         private String originalPath;
>> 66:         private int originalFlags;
>> 67:         private long originalOffset;
> Regarding the design, path and offset are features of a file desriptor referring to the filesystem, but they do not make sense to socket FD.

Yes, you could add special classes for Sockets vs. Files. It's easier, though, to treat this in single POJO and keep the path `null` if it does not make sense in this case.

> src/java.base/share/classes/java/io/FileDescriptor.java line 456:
>> 454:             // this is used probably as the file moved on the filesystem but the contents
>> 455:             // are the same.
>> 456:             if (!reopen(resource.originalFd, path, resource.originalFlags, resource.originalOffset)) {
> Another option is a log file in the append mode, which may grow larger -- in that case we'd like to have that in append mode with position at the end. Probably that is handled by setting proper flags, but at least this would contradict with the comment.

This handling is meant for read-only access, too.
I don't think that the concept of 'appending' makes sense from CRaC POV - the append flag just says whether you've started at the beginning or at the end; but this aims at transparent continuation of what you were doing as if no checkpoint happened.


PR Review Comment: https://git.openjdk.org/crac/pull/69#discussion_r1224108861
PR Review Comment: https://git.openjdk.org/crac/pull/69#discussion_r1224107338

More information about the crac-dev mailing list