-
Notifications
You must be signed in to change notification settings - Fork 5
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
Questions about hooks #10
Comments
Do you forsee needing to impose an order on the hooks? I'm happy to discuss a better option than serialization. |
I would like to clear up some confusion on my part about the management of:
I will admit my grasp of how the restore side works when transforming the running Java instance (running the As for order, I was planning on that being able to be controlled from the Open Liberty side in the registration of the hooks on our side. As of now I don't have good examples where hook order matters, but I will not be surprised if it comes up. But this does bring up a good point if the same hook object does the prepare and restore then it may make sense to do the restore in the reverse order of the prepare order. |
I think one scenario in which order of hooks may matter is if we had a distinction between "application" hooks and "JVM" hooks, e.g. we might want to compact the Java heap and release unneeded memory to the OS in the JVM hook as one of the last actions before taking a snapshot to keep its size small. |
Currently restore hooks only get run if you use the java restore
interface.
I need to think a little bit more about a way to do this when restore
happens via the command line. It's not obvious because you restore back
to where you were at the checkpoint code and there isn't a good place to
add the call to execute the restore hooks only if you are in the criu
restored jvm and not in the original jvm. I may be making this too hard.
…On Mon, Apr 26, 2021 at 3:44 PM Vijay Sundaresan ***@***.***> wrote:
I think one scenario in which order of hooks may matter is if we had a
distinction between "application" hooks and "JVM" hooks, e.g. we might want
to compact the Java heap and release unneeded memory to the OS in the JVM
hook as one of the last actions before taking a snapshot to keep its size
small.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE3CLBHTXNO3FLKO4Y4WXFDTKW7ANANCNFSM43TCTA7Q>
.
|
Experimenting with CRIU for a relatively complex application (in my case Open Liberty https://github.com/OpenLiberty/open-liberty) I have my doubts on the hook for CheckpointRestore.
My main doubt is in the requirement to serialize on the dump operation and deserialize on the restore operation. If on a dump the complete process and all of its state is saved in the image dump then why do we also need to save the state of the hooks with serialization separately? Would we not already have the hooks objects available to us once we restore such that we can call the restore side straight away when the process is resumed?
For Open Liberty I likely will need to introduce my own hook SPI/API [1] to give us the flexibility to have subsystems within Liberty to participate in the prepare/restore operations anyways, but my current thinking is to not have the hooks get serialized at all. The general flow is
criu
command to restore, I would like to avoid invoking the JVM to restore to avoid overhead of firing up a Java processMy reason for opening this issue is to discuss the strategy for how the hooks work in JavaCriuJar to make sure I am not overlooking something in my strategy that I described above for Open Liberty.
If my understanding is correct we could decide to push a similar strategy down into the JavaCriuJar library. The difficulty I will have with that is that I need the ability to separate the CheckPointRestore/Hook API from the implementation such that the implementation can be installed on top while lower levels of Open Liberty can participate and implement the restore/prepare hooks without requiring the actual implementation of CheckPointRestore be available at runtime. One solution to that is to separate the JavaCriuJar into to JARs: 1) for API 2) for implementation. On the other hand I am also fine with Open Liberty having its own hook API and only using JavaCriuJar for invoking the criu lib calls to perform the dump.
[1] https://github.com/tjwatson/open-liberty/blob/criu/dev/com.ibm.ws.kernel.boot.core/src/io/openliberty/checkpoint/spi/SnapshotHook.java
The text was updated successfully, but these errors were encountered: