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

Radim Vansa duke at openjdk.org
Fri Jun 9 10:19:17 UTC 2023

On Fri, 9 Jun 2023 10:01:27 GMT, Radim Vansa <duke at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/crac/impl/OpenFDPolicies.java line 23:
>>> 21: public class OpenFDPolicies<P> {
>>> 22:     public static final String CHECKPOINT_PROPERTY = "jdk.crac.fd-policy.checkpoint";
>>> 23:     public static final String RESTORE_PROPERTY = "jdk.crac.fd-policy.restore";
>> Having separated policies for checkpoint and restore enables some weird configuration, when e.g. checkpoint specifing CLOSE and restore -- REOPEN. It would be better to have a combined, consisted checkpoint-restore policy that specifes both parts at once.
> I've started with a single policy enum but it turned out the inlined cross product of behaviours was rather a long and repetitive.
> In fact CLOSE + REOPEN is the combination that makes a perfect sense. You close the file on checkpoint (rather than error out and fail the checkpoint) and then you reopen the same file (rather than opening something else).

And note that the restore configuration should be set on restore, because in case of opening other files you don't know where these are in the deployment (restore) environment during checkpoint. Had you specified the policy together you would be overriding the behaviour on checkpoint which was already executed, which is even more confusing.


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

More information about the crac-dev mailing list