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

CRIU restore clears InetAddress.cache #17448

Merged
merged 1 commit into from
May 26, 2023

Conversation

JasonFengJ9
Copy link
Member

@JasonFengJ9 JasonFengJ9 commented May 23, 2023

CRIU restore clears InetAddress.cache

A post-restore hook clearInetAddressCache() is added to clear InetAddress.cache.

This change prevents JVM DNS cache before checkpoint which might cause DNS resolution timeout after the CRIU image is restored at a different environment.
Related

Signed-off-by: Jason Feng [email protected]

@JasonFengJ9 JasonFengJ9 added comp:vm criu Used to track CRIU snapshot related work labels May 23, 2023
@JasonFengJ9 JasonFengJ9 requested a review from tajila May 23, 2023 15:43
@tajila
Copy link
Contributor

tajila commented May 23, 2023

Can we just clear the cache with the restore hook? in java.net.InetAddress

private static final ConcurrentMap<String, Addresses> cache =
        new ConcurrentHashMap<>();

private static final NavigableSet<CachedAddresses> expirySet =
        new ConcurrentSkipListSet<>();

@JasonFengJ9
Copy link
Member Author

Good catch, I thought the mapping caches are saved in InetAddress instances, will change it.

@JasonFengJ9 JasonFengJ9 changed the title CRIU restores InetAddressCachePolicy.cachePolicy value after restore CRIU restore clear InetAddress.cache May 23, 2023
@JasonFengJ9 JasonFengJ9 changed the title CRIU restore clear InetAddress.cache CRIU restore clears InetAddress.cache May 23, 2023
@JasonFengJ9
Copy link
Member Author

@tajila this is ready for another look.

A post-restore hook clearInetAddressCache() is added to clear
InetAddress.cache.

Signed-off-by: Jason Feng <[email protected]>
@tajila
Copy link
Contributor

tajila commented May 25, 2023

jenkins test sanity xlinux jdknext depends ibmruntimes/openj9-openjdk-jdk#604

@tajila
Copy link
Contributor

tajila commented May 25, 2023

jenkins test sanity xlinux jdk17 depends ibmruntimes/openj9-openjdk-jdk17/pull/216

@JasonFengJ9
Copy link
Member Author

JDK17 build error

ERROR: Cannot parse dependent change: 'ibmruntimes/openj9-openjdk-jdk17/pull/216'

It seems to expect the format ibmruntimes/openj9-openjdk-jdk17#216

@tajila
Copy link
Contributor

tajila commented May 25, 2023

jenkins test sanity xlinux jdk17 depends https://github.com/ibmruntimes/openj9-openjdk-jdk17#216

@tajila
Copy link
Contributor

tajila commented May 25, 2023

jenkins test sanity xlinux jdk11 depends https://github.com/ibmruntimes/openj9-openjdk-jdk11#661

@tajila
Copy link
Contributor

tajila commented May 26, 2023

jenkins test sanity xlinux jdk17 ibmruntimes/openj9-openjdk-jdk17#216

@tajila
Copy link
Contributor

tajila commented May 26, 2023

jenkins test sanity xlinux jdk11 depends ibmruntimes/openj9-openjdk-jdk11#661

@tajila
Copy link
Contributor

tajila commented May 26, 2023

11:57:57  ERROR: Build failed for target 'all' in configuration 'linux-x86_64-server-release' (exit code 2) 
11:57:57  
11:57:57  === Output from failing command(s) repeated here ===
11:57:57  * For target jdk_modules_openj9.criu__the.openj9.criu_batch:
11:57:57  /home/jenkins/workspace/Build_JDK17_x86-64_linux_Personal/build/linux-x86_64-server-release/support/j9jcl/openj9.criu/share/classes/org/eclipse/openj9/criu/CRIUSupport.java:624: error: cannot find symbol
11:57:57  		SharedSecrets.getJavaNetInetAddressAccess().clearInetAddressCache();

on the jdk17 build

@JasonFengJ9
Copy link
Member Author

error: cannot find symbol
SharedSecrets.getJavaNetInetAddressAccess().clearInetAddressCache();
on the jdk17 build

It passed at https://openj9-jenkins.osuosl.org/job/Build_JDK17_x86-64_linux_Personal/554/
I think jenkins test sanity xlinux jdk17 https://github.com/ibmruntimes/openj9-openjdk-jdk17/pull/216 missed depends.

@tajila
Copy link
Contributor

tajila commented May 26, 2023

oh yes, thanks

@tajila tajila merged commit 12286f5 into eclipse-openj9:master May 26, 2023
@JasonFengJ9 JasonFengJ9 deleted the criunocache branch May 26, 2023 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:vm criu Used to track CRIU snapshot related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants