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

Radim Vansa rvansa at openjdk.org
Wed Jul 19 15:21:23 UTC 2023


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

> When the application does not close some file descriptors through Resources we can use `jdk.crac.resource-policies` pointing to a configuration file that might adjust the behaviour. The file uses a simple YAML-conformant format with individual rules separated by a line with `---`:
> 
> 
> type: file
> path: /path/to/*.txt
> action: close
> ---
> type: socket
> localAddress: 127.0.0.1
> localPort: 8080
> action: ignore
> 
> 
> Available types:
> * `file`: supports `path` with 'glob' pattern matching (see FileSystem.getPathMatcher() for details)
> * `pipe`: anonymous pipes (named pipe is handled as `file`)
> * `socket`: can be refined using `family`, `localAddress`, `localPort`, `localPath` (in case of Unix sockets), `remoteAddress`, `remotePort` and `remotePath`
> 
> Actions depend on each resource, defaulting to `error`, with common options `close` and `ignore`. Files have `reopen` action, too.

This pull request has now been integrated.

Changeset: 861df70b
Author:    Radim Vansa <rvansa at openjdk.org>
URL:       https://git.openjdk.org/crac/commit/861df70be9ffab14a5e22b5e40108f5d3717c263
Stats:     2312 lines in 48 files changed: 2201 ins; 36 del; 75 mod

Handle open file descriptors with configurable policies

Reviewed-by: akozlov

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

PR: https://git.openjdk.org/crac/pull/69


More information about the crac-dev mailing list