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

Radim Vansa rvansa at openjdk.org
Wed Jul 19 11:32:43 UTC 2023


> 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.

Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:

  Refactor partially duplicated messages

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

Changes:
  - all: https://git.openjdk.org/crac/pull/69/files
  - new: https://git.openjdk.org/crac/pull/69/files/fe9a0456..a170ab56

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=crac&pr=69&range=14
 - incr: https://webrevs.openjdk.org/?repo=crac&pr=69&range=13-14

  Stats: 32 lines in 6 files changed: 12 ins; 14 del; 6 mod
  Patch: https://git.openjdk.org/crac/pull/69.diff
  Fetch: git fetch https://git.openjdk.org/crac.git pull/69/head:pull/69

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


More information about the crac-dev mailing list