[crac] RFR: Close extraneous file descriptors [v2]

Radim Vansa duke at openjdk.org
Thu Feb 23 07:40:37 UTC 2023


On Wed, 22 Feb 2023 16:47:17 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> Radim Vansa has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
>> 
>>  - Remove unneeded check
>>  - Applied review suggestions
>>  - Close non-standard file descriptors on boot
>>    
>>    If the process is configured for Checkpoint and is started with open file descriptors (e.g. inherited from parent process), under some circumstances CRIU cannot properly execute the checkpoint. Prevent this be proactively closing file descriptors > 2 on boot.
>>    This behaviour can be overriden by settings -XX:CRIgnoreFileDescriptors to a comma-separated list of FD numbers or paths these file descriptors map to.
>
> src/hotspot/share/runtime/globals.hpp line 2103:
> 
>> 2101:       "unavailable")                                                        \
>> 2102:                                                                             \
>> 2103:   product(ccstr, CRaCIgnoredFileDescriptors, NULL, "Comma-separated list "  \
> 
> Should not `0,1,2` be the default option then? So it will be also possible to overwrite this default.

I didn't use `0,1,2` as if you want to ignore FD 42 you would have to write `0,1,2,42` rather than just 42. Starting with standard FDs closed is extremely non-standard, and in that case we should do something about `System.out` as well to be consistent.

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

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


More information about the crac-dev mailing list