Skip to content

8378446: [CRaC] Replace libcrexec with libcriuengine#297

Open
rvansa wants to merge 4 commits intoopenjdk:cracfrom
rvansa:crexec_to_criuengine
Open

8378446: [CRaC] Replace libcrexec with libcriuengine#297
rvansa wants to merge 4 commits intoopenjdk:cracfrom
rvansa:crexec_to_criuengine

Conversation

@rvansa
Copy link
Collaborator

@rvansa rvansa commented Feb 24, 2026

After JDK-8376959 the only use of libcrexec is running CRIU; in fact the code already is quite CRIU-dependent. The point of this task is to stop pretending that libcrexec is generic, and move code from criuengine binary (now removed) into libcriuengine implementing the C/R API.

This removes smuggling of some parameters through environment variables and execution of the criuengine. We still require anexecuteable (now called criuhelper) to become parent of the restored process, but this has significantly simplified implementation.

Replacement of communication between the restoring and restored process through signals and temporary files is out of scope of this change.


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8378446: [CRaC] Replace libcrexec with libcriuengine (Task - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/crac.git pull/297/head:pull/297
$ git checkout pull/297

Update a local copy of the PR:
$ git checkout pull/297
$ git pull https://git.openjdk.org/crac.git pull/297/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 297

View PR using the GUI difftool:
$ git pr show -t 297

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/crac/pull/297.diff

Using Webrev

Link to Webrev Comment

@rvansa rvansa requested a review from TimPushkin February 24, 2026 10:44
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 24, 2026

👋 Welcome back rvansa! A progress list of the required criteria for merging this PR into crac will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Feb 24, 2026

@rvansa This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8378446: [CRaC] Replace libcrexec with libcriuengine

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the crac branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the crac branch, type /integrate in a new comment.

@openjdk
Copy link

openjdk bot commented Feb 24, 2026

@rvansa this pull request can not be integrated into crac due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout crexec_to_criuengine
git fetch https://git.openjdk.org/crac.git crac
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge crac"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch rfr Pull request is ready for review labels Feb 24, 2026
@mlbridge
Copy link

mlbridge bot commented Feb 24, 2026

Webrevs

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed merge-conflict Pull request has merge conflict with target branch labels Feb 24, 2026
return;
if (is_vm_statically_linked()) {
log_warning(crac)("Cannot load CRaC engine API entrypoint '%s' from %s", resolved_engine_func, path);
// Maybe the deprecated short name was used, in that case find_engine did not amend the 'engine'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For static VM we take a shortcut as we cannot check the filesystem path: https://github.com/rvansa/crac/blob/807167d37ca7cf6e2b079d18a45a768e24478083/src/hotspot/share/runtime/crac_engine.cpp#L135

Yes, it is redundant, so I hope to remove this in 28 when we don't allow short engine names anymore.

}
}

static int restorewait(void) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that this is needed because CRIU's executable (which this helper replaces as the restoree's parent) does not handle signals and return values in the same manner?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, the process triggering restore might think that it can use the signals normally. This code can be traced back all the way to f25eb7b#diff-b768a59a1eadf0ad4a63bd5011db6952a5ecc7cbaa88e236f65798e38d42f117R12-R235

@rvansa
Copy link
Collaborator Author

rvansa commented Feb 26, 2026

Failure on MacOS is in JdwpTransportTest - looks like this test got more unstable recently.

@rvansa rvansa requested a review from TimPushkin February 26, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants