Repository navigation
force_refresh also rebuilds the cached Owlery id list - #126
Open
Robbie1977 wants to merge 2 commits into
Open
Robbie1977 wants to merge 2 commits into
Robbie1977 wants to merge 2 commits into
Conversation
…esult A forced refresh cleared only the query result and recomputed it from the still-cached owlery_ids layer, so after a data load (new BANC neurons) it returned the same stale set. Raise a context flag for the duration of a forced call and pass it to _owlery_ids_cached. get_term_info is excluded (its force path already fans out per query).
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
force_refreshon an Owlery-based query (ImagesNeurons,NeuronsPartHere,PartsOf, ...) cleared only the finished result and then recomputed it from the still-cached Owlery id list (owlery_ids), so a refresh after a data load returned the same stale set. Seen on the cluster 2026-10-12:ImagesNeurons(FBbt_00040051)was 2678 cached vs 3206 live after the BANC v888 load, and three forced refreshes changed nothing. The server log shows it:Force refresh requested for images_neurons(...)followed byCache hit for owlery_ids(...).Fix
A forced call now sets a context flag (
solr_result_cache.force_fresh_active()), and_owlery_query_to_resultspasses it to_owlery_ids_cached(force_refresh=...), so both layers are rebuilt.get_term_infodoes not set the flag (its force path already fans out per query and forwardsforce_refreshwhere a query takes it).ContextVar, not a keyword, so cache field names don't split between refreshed and normal calls.Tests
tests/test_force_refresh_owlery_ids.py(offline): the flag is off by default and reset after the call;term_infodoes not raise it; it reaches_owlery_ids_cachedthroughget_images_neurons. Together withtests/test_force_refresh_header.py: 20 passed.CACHING.md has a new section, "force_refresh and the Owlery id list".