[crac] RFR: Improved open file descriptors tracking

Radim Vansa duke at openjdk.org
Tue Jan 31 10:34:43 UTC 2023


Tracks `java.io.FileDescriptor` instances as CRaC resource; before checkpoint these are reported and if not allow-listed (e.g. as opened as standard descriptors) an exception is thrown. Further investigation can use system property `jdk.crac.collect-fd-stacktraces=true` to record origin of those file descriptors.
File descriptors claimed in Java code are passed to native; native code checks all open file descriptors and reports error if there's an unexpected FD that is not included in the list passed previously.

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

Commit messages:
 - Avoid claiming invalid FileDescriptor
 - Whitelist RandomAccessFile opening classpath files
 - Add tracking of FD origin
 - Track FileDescriptors closed by NIO
 - Track native FDs from EPoll
 - Ignore FileDescriptors closed externally
 - Better FD, does not work
 - Finish claimFD
 - WIP
 - WIP
 - ... and 1 more: https://git.openjdk.org/crac/compare/65e0785e...432c3f73

Changes: https://git.openjdk.org/crac/pull/43/files
 Webrev: https://webrevs.openjdk.org/?repo=crac&pr=43&range=00
  Stats: 602 lines in 26 files changed: 361 ins; 204 del; 37 mod
  Patch: https://git.openjdk.org/crac/pull/43.diff
  Fetch: git fetch https://git.openjdk.org/crac pull/43/head:pull/43

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


More information about the crac-dev mailing list