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

Deal with differences between snapshot creation and restore environments #12484

Open
vijaysun-omr opened this issue Apr 20, 2021 · 2 comments
Open
Labels
criu Used to track CRIU snapshot related work

Comments

@vijaysun-omr
Copy link
Contributor

vijaysun-omr commented Apr 20, 2021

There could be differences between the environment where a snapshot gets created and the environment where the snapshot gets restored and run.

These differences could be related to:

  1. Number of CPUs : affects thread counts in both the JVM (GC and JIT) and potentially the application (e.g. Liberty thread pool) if these are based on initialization done when the snapshot is created
  2. Amount of RAM : affects heuristics for how much Java heap the JVM could end up using at run time
  3. Random seeds need to be changed to avoid same sequences on all restored JVMs
  4. File handles need to be attached properly, e.g. stdout/stderr in detached container
  5. Timers need to be fixed up to avoid running N times to “catch up” after restore
  6. Locale : a snapshot can be restored in a locale that is different to the one where the snapshot was created, e.g. via something like http://jaredmarkell.com/docker-and-locales/
  7. TimeZone needs to be fixed up for restored locale environment
  8. Date needs to be fixed up for restored environment
  9. Environment variables need to be picked up from restored environment
  10. Reset TLS stack, verify root certificates, SecureRandom entropy
  11. ManagementFactory.getRuntimeMXBean().getUptime() (and maybe other similar fields) need to be restored to avoid giving large values for delta between snapshot and restore times

@DanHeidinga this issue can be used to catalogue what all we need to fix in the OpenJ9 hooks

@vijaysun-omr
Copy link
Contributor Author

This is part of issue 16384

@vijaysun-omr vijaysun-omr added criu Used to track CRIU snapshot related work and removed snapshot labels Apr 20, 2021
@DanHeidinga
Copy link
Member

After discussion with Vijay, I've hosted this content https://cr.openjdk.java.net/~heidinga/crac/snapshot_env_differences.md and posted it for discussion in OpenJDK's CRaC project: https://mail.openjdk.java.net/pipermail/crac-dev/2021-October/000031.html

My goal is to work towards a common approach - new library feature? language changes? time will tell - to these kinds of issues. Especially useful if we can produce a single set of adaptations that can be broadly used by all consumers.

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
Projects
Status: No status
Development

No branches or pull requests

2 participants