Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can CRIU interop with CRAC #17420

Closed
AngeloRubens opened this issue May 17, 2023 · 7 comments
Closed

Can CRIU interop with CRAC #17420

AngeloRubens opened this issue May 17, 2023 · 7 comments
Labels
criu Used to track CRIU snapshot related work question userRaised

Comments

@AngeloRubens
Copy link

hi all,

can openj9 support jdk Crac project by Criu Feature?

@AngeloRubens AngeloRubens added the criu Used to track CRIU snapshot related work label May 17, 2023
@JasonFengJ9
Copy link
Member

can openj9 support jdk Crac project by Criu Feature?

What CRAC features you are looking for are not provided by OpenJ9?

FYI @tajila

@AngeloRubens
Copy link
Author

for compatibility feature, like -XX:[+|-]IgnoreUnrecognizedVMOptions compatibility from openjdk and openj9...

@DanHeidinga
Copy link
Member

There are a lot of similarities between OpenJ9's CRIU support and OpenJDK's Project CRaC but they aren't in the realm of mapping from one command line option to the other.

Both use CRIU to take a checkpoint of the running JVM and then to restore it later. Both have a "lifecycle api" that allows hooks to run before the checkpoint and after the restore to fix up the state.

But the model for executing those hooks is different:

  • CRaC allows all threads to continue to execute while lifecycle api hooks are running which exposes a lot of concurrency issues between "normal operation" and the "fixup code".
  • OpenJ9 instead enters into "single threaded mode" and only allows a single thread to execute the lifecycle api hooks. All other threads are paused. This makes the concurrency model simpler and ensures a more consistent environment after the hooks are complete but comes at the cost of potential deadlocks.

Both use their lifecycle apis to fix up the OpenJDK classlibrary so mapping there is covered. But user code that wants to operate with either OpenJ9 CRIU or OpenJDK CRaC needs to interoperate with one or the others lifecycle apis. The way those apis are exposed and used - and thought about ie: concurrency - are different and require different approaches by users.

I'm sure there's other differences but this should be sufficient to show that mapping one to the other isn't a simple operation unfortunately.

If you're interested in OpenJ9 CRIU - or have been playing with CRaC - we'd love to hear the use case and hear about how the checkpoint/restore is helping. And what improvements / enhancements / pain points you might have.

@AngeloRubens
Copy link
Author

AngeloRubens commented May 18, 2023

my contribution just wanted to have a standard api to allow apps running on the jvm to interact with CRIU in the same way for both openj9 and open-jdk. In this moment there are two interface, this for crac https://github.com/CRaC/org.crac/blob/master/src/main/java/org/crac/Resource.java and this for openj9 CRIU jcl/src/openj9.criu/share/classes/org/eclipse/openj9/criu/CRIUSupport.java. When write an application/container(opneliberty,springboot, payara, tomee or my custom app) and i want handle the event beforeCheckPoint and afterRestore i managed both implementation. if i have a standard api i will run my app in the same manner.

@tajila
Copy link
Contributor

tajila commented Jul 7, 2023

@AngeloRubens you may be interested in OpenLiberty/open-liberty#25594

@tajila
Copy link
Contributor

tajila commented Oct 28, 2024

@AngeloRubens OpenJ9 now has support for -XX:CRaCCheckpointTo= and -XX:CRaCRestoreFrom= as well as CRAC org.crac APIs.

@tajila tajila closed this as completed Oct 28, 2024
Copy link

Issue Number: 17420
Status: Closed
Actual Components: question, userRaised, criu
Actual Assignees: No one :(
PR Assignees: No one :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
criu Used to track CRIU snapshot related work question userRaised
Projects
None yet
Development

No branches or pull requests

4 participants