Skip to content

Stop double-caching term_info and template_roi_tree#51

Merged
Robbie1977 merged 1 commit into
mainfrom
fix-term-info-double-cache
Jun 24, 2026
Merged

Stop double-caching term_info and template_roi_tree#51
Robbie1977 merged 1 commit into
mainfrom
fix-term-info-double-cache

Conversation

@Robbie1977

Copy link
Copy Markdown
Contributor

Fixes the duplicated term-info cache work seen in the logs after v1.22.0.

get_term_info_cached and get_template_roi_tree_cached each carried @with_solr_cache and 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 *_cached versions into vfb_queries, every request ran the SOLR cache layer twice — two reads and two writes for the same key (the duplicated Cached 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 _cached wrapper is undecorated and relies on its decorated original.

  • Drop the redundant decorator from both *_cached functions.
  • For template_roi_tree, also forward force_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.22 bump just made it loud during the cache reload.

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.
@Robbie1977 Robbie1977 merged commit 72aebdb into main Jun 24, 2026
2 of 4 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.

1 participant