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

Fix caching issues which render remote ref caching ineffective #466

Merged
merged 2 commits into from
Jul 27, 2024

Conversation

sirosen
Copy link
Member

@sirosen sirosen commented Jul 27, 2024

  • Fix flake8 config to load properly in precommit
  • Fix rebuild of validator per instance & cache bug

Fixes #463

The schema loader is asked to retrieve a validator per instance, in
order to support the interface of metaschema evaluation. However, this
results in a complete rebuild of the validator even when there is one
schema being used for many instances (as in the `--schemafile` usage
mode).

Introducing an LRU cache on the validator builder results in the same
validator being reused (and is sensitive to changes in
settings/parameters).

Additionally fix a bug in the remote ref download caching in which the
key used for lookup was incorrect, rendering the cache completely
ineffective.

A new regression test confirms that the caching is fully effective by
only observing the number of requests made by the program over "N"
instancefiles, where N>=1.
@sirosen sirosen merged commit 60edab9 into main Jul 27, 2024
45 checks passed
@sirosen sirosen deleted the fix-rebuild-bug branch July 27, 2024 22:20
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.

New validator instances are built for each instancefile, discarding any internal caching
1 participant