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

Radim Vansa duke at openjdk.org
Fri May 12 11:02:34 UTC 2023


On Fri, 12 May 2023 10:54:50 GMT, Radim Vansa <duke at openjdk.org> wrote:

> When the application does not close some file descriptors through Resources we can use `jdk.crac.fd-policy.checkpoint` and `jdk.crac.fd-policy.restore` to configure the behaviour.
> 
> These properties can specify a list of File.pathSeparator-separated key=value pairs, where the key can be one of:
> 
> * numeric file descriptor
> * path using 'glob' pattern matching (see FileSystem.getPathMatcher() for details)
> * keywords FIFO and SOCKET that match pipes and sockets
> 
> The value should match one of possible values from OpenFDPolicies.BeforeCheckpoint and OpenFDPolicies.AfterRestore

Some workarounds in this PR could be reverted if #66 gets integrated.

I've also moved OpenFDPolicies from `jdk.crac` to `jdk.crac.impl` at the last moment. While the static methods should stay in impl, I wonder if we should publish the property names and enum values in `jdk.crac` and make such 'configuration' a part of the API. In the current state I don't know where should the documentation for these policies land.

-------------

PR Comment: https://git.openjdk.org/crac/pull/69#issuecomment-1545561787


More information about the crac-dev mailing list