[crac] RFR: Handle open file descriptors with configurable policies [v3]
Radim Vansa
duke at openjdk.org
Fri Jun 9 15:48:07 UTC 2023
On Fri, 9 Jun 2023 15:34:44 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:
>>> I've started with a single policy enum but it turned out the inlined cross product of behaviours was rather a long and repetitive.
>>
>> Do you have artifacts of that? Because it may mean that cross-product may have a few invalid / unsafe behaviors. It would be interesting to look at the list.
>>
>>> In fact CLOSE + REOPEN is the combination that makes a perfect sense.
>>
>> Indeed, bad example. What about ERROR+OPEN_OTHER. Or for the sockets, for the current implementation we should not allow OPEN_OTHER, as the implementation can only throw RestoreException in this case.
>
>> 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.
>
> The combined policy can have additional parameters settable on restore. But the combined policy should be able to limit policies or parameters for restore part of the policy.
When the behaviour is ERROR, you won't have a chance to use OPEN_OTHER, because you never get to restore.
If you set policy OPEN_OTHER on FD 42, the restore will throw an exception. We could completely fail the restore and exit, too. So yes, we do not allow that.
We could fail when already reading policies that look like SOCKET=OPEN_OTHER:..., why not add an extra check. But failing when we actually try to do that is only a fraction of second later.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/69#discussion_r1224473302
More information about the crac-dev
mailing list