Skip to content

Invalidate global vars containing parsed images in Explore* methods #210

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

Merged
merged 1 commit into from
May 31, 2025

Conversation

pbeschetnov
Copy link
Contributor

Caching common criu images in global variables doesn't work in these scenarios:

  • crit.Explore...() are used in different img directories
  • between crit.Explore...() img files are updated (new dump happened)

With this PR I'm fixing this problem and supporting listed cases by invalidating the caches during each Explore call.

@snprajwal
Copy link
Member

Thank you for catching this issue! I like the idea, but it looks like we currently invalidate the cache even if we are running the command on the same directory as before. It would be good if we can have another global variable that stores the directory that we are caching the images from. We can compare this to the dir passed into getFile, getRegFilePath, etc, and invalidate the cache if they are different. If not, we can use the cached images.

@snprajwal
Copy link
Member

snprajwal commented May 30, 2025

It looks like you were already doing the above in the first commit :) that would be nice to have. Please note that we use self-contained commits without follow-up fixup commits -please squash your commits into a single one. It would also be great if you could write a descriptive commit message that explains the intent of the commit better. Thanks!

Copy link

codecov bot commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.12%. Comparing base (a3d9050) to head (d411ab1).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #210      +/-   ##
==========================================
+ Coverage   49.80%   50.12%   +0.32%     
==========================================
  Files          21       21              
  Lines        2307     2322      +15     
==========================================
+ Hits         1149     1164      +15     
  Misses       1019     1019              
  Partials      139      139              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Caching common criu images in global variables doesn't work in
these scenarios:

1. crit.Explore...() are used in different img directories
2. between crit.Explore...() img files are updated (new dump happened)

This patch fixes this problem by invalidating the caches during
each Explore call.

Signed-off-by: Pavel Beschetnov <[email protected]>
Signed-off-by: Radostin Stoyanov <[email protected]>
Copy link
Member

@rst0git rst0git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pbeschetnov Thank you for fixing this!

@rst0git rst0git merged commit cc60bab into checkpoint-restore:master May 31, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants