Stop double-caching term_info and template_roi_tree#51
Merged
Conversation
get_term_info_cached and get_template_roi_tree_cached each carried @with_solr_cache while also delegating to an original (get_term_info / get_template_roi_tree) that is itself decorated with the same bucket. The caching patch swaps the *_cached versions into vfb_queries, so every request ran the SOLR cache layer twice — two cache reads and two writes for the same key (visible as duplicated 'Cached term_info ...' / 'Cache invalidated ...' log lines, and doubled Solr writes). Every other _cached wrapper is undecorated and relies on its decorated original; these two were the only double-wraps. Drop the redundant decorator from both. For template_roi_tree also forward force_refresh, which the outer decorator previously consumed (the body did not pass it through). No behaviour change beyond halving the cache work/writes per request.
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.
Fixes the duplicated term-info cache work seen in the logs after v1.22.0.
get_term_info_cachedandget_template_roi_tree_cachedeach carried@with_solr_cacheand delegated to an original (get_term_info/get_template_roi_tree) that is itself decorated with the same bucket. Since the caching patch swaps the*_cachedversions intovfb_queries, every request ran the SOLR cache layer twice — two reads and two writes for the same key (the duplicatedCached term_info …/Cache invalidated …log lines, and doubled Solr writes).A cross-check of both modules confirmed these were the only two double-wraps; every other
_cachedwrapper is undecorated and relies on its decorated original.*_cachedfunctions.template_roi_tree, also forwardforce_refresh(the outer decorator previously consumed it; the body didn't pass it through).No behaviour change beyond halving cache work/writes per term-info request. Pre-existing bug; the
1.21→1.22bump just made it loud during the cache reload.