[crac] RFR: Environment vars propagation into restored process [v3]
Dan Heidinga
heidinga at openjdk.org
Wed Feb 1 18:46:37 UTC 2023
On Mon, 3 Oct 2022 08:21:56 GMT, Roman Marchenko <rmarchenko at openjdk.org> wrote:
>> This PR provides functionality to propagate actual environment variables to a restored process, as well as the test for this functionality.
>>
>> Env propagation is done in few steps:
>> - Store the actual environment before restoring
>> - After restoring, replace the restored `environ` with a new one.
>> - On `afterRestore` event, propagate the new environment into a restored process via `ProcessEnvironment`.
>
> Roman Marchenko has updated the pull request incrementally with one additional commit since the last revision:
>
> Fixing review comments
The updated test doesn't really address the concern though. The key concern was:
> limit the env var changes to only add new env vars (no inconsistencies).
OpenJ9 did this by constraining the checkpoint env to only capture a limited subset of env vars and allowing restore to expand that set with new env vars.
The current CRaC approach still allows overriding env vars, which is something Java (and developers, and library developers) doesn't expect to happen so they haven't written their code to be aware these values can change. Changing existing env vars on restore will just lead to inconsistent systems. See [0] for more details on why this is the case.
[0] https://github.com/openjdk/crac/pull/30#issuecomment-1268433596
-------------
PR: https://git.openjdk.org/crac/pull/30
More information about the crac-dev
mailing list