Replies: 2 comments 3 replies
-
|
@david-ic3, we are not much familiar with CRaC. Would you mind providing a minimal single-Java-file example along with instructions to reproduce the failure, please? |
Beta Was this translation helpful? Give feedback.
-
|
Giving you a single java file might not be easy. But I'll try to explain what we would need and what we've hacked until now. With CRaC, the state (aka., checkpoint) of the JVM process can be stored to disk. Then later, the JVM can be started right from this self-contained state very quickly. E.g., even the already compiled bytecode is restored. Before the checkpoint is actually made by the JVM, the application logic has to somehow disconnect itself from the external world : for example, files and sockets need to be closed. And upon restoration, the application will reconnect accordingly to the external world. For that purpose, CRaC provides an entry point where we can register Resources that basically implements two methods : So ideally, we would need somehow a way to do something like: and having Log4j doing all the magic for the well known appenders ;-) So far, this is what we've found and are doing assuming we've with the helper code : So far, it seems to work nicely and we are able to checkpoint and restore our Java application with Log4j still working as expected. It would be nice to have this kind of support built in Log4j somehow. Right now, I've the feeling that our code is a bit of a hack ;-) Let me know if you need more information. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What is the best practice to support Log4J when using CRaC ?
In our code loggers are defined statically (yes this is the problem but ideally we do not change this) :
public static final Logger GENERAL = Logger.getLogger("icCube.general");The CRaC supported by :
Running now our code :
After restore the static logger are not bind to the 'new' Logger. Is there a way to rebind/reset the loggers or a best practice ?
Beta Was this translation helpful? Give feedback.
All reactions