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

Improving verrou_dd cache invalidation #9

Closed
HadrienG2 opened this issue Jun 19, 2018 · 2 comments
Closed

Improving verrou_dd cache invalidation #9

HadrienG2 opened this issue Jun 19, 2018 · 2 comments

Comments

@HadrienG2
Copy link
Contributor

HadrienG2 commented Jun 19, 2018

verrou_dd only invalidates its cache when the run-script or the cmp-script change. But these scripts usually recursively call other binaries or touch configuration files which verrou_dd has no knowledge of. Therefore, the dd.sym cache is often reused when it shouldn't be.

I propose two possible strategies to deal with this, a sane but unsatisfying one an a less sane but more powerful strategy:

  • Sane-but-meh option: Invalidate the cache by default when a top-level verrou_dd command is run. If the command calls itself recursively, make sure that the recursive invocations do not invalidate the cache. This can be done by adding an optional "--reuse-cache" script option, which will also allow users who know what they are doing to reuse a cache from a previous run.
  • Insane option: In principle, one could strace run-script or cmp-script calls in order to tell which files the run_script and cmp_script recursively depend on, and then compute a hash of them to detect dependency changes... ^^
@HadrienG2 HadrienG2 mentioned this issue Jun 19, 2018
6 tasks
@ffevotte
Copy link
Member

verrou_dd only invalidates its cache when the run-script or the cmp-script change

Please note that even this simple heuristic is not used currently. At the moment, Verrou never invalidates its cache which, as you note, is not a good idea as it misleads users most of the time.

I would be in favor of implementing your 'sane-but-meh' option in a first stage, then see whether more is needed. We also have a few ideas regarding helper scripts which could allow (advanced) users to invalidate only parts of the cache. For example: invalidate successful tests if a verrou_dd error reveals that VERROU_DD_NRUNS was set to a too small value).

@lathuili
Copy link
Contributor

lathuili commented Jun 1, 2021

Since the v2.3.1version you can configure the cache behaviour with the option --cache.

@lathuili lathuili closed this as completed Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants