Skip to content

remove redundant translation cache clearing from TranslationController#67

Merged
solverat merged 2 commits into1.xfrom
fix_translation_tag_clear
Mar 30, 2026
Merged

remove redundant translation cache clearing from TranslationController#67
solverat merged 2 commits into1.xfrom
fix_translation_tag_clear

Conversation

@solverat
Copy link
Copy Markdown
Contributor

Remove redundant Translation::clearDependentCache() calls from TranslationController

  • Remove premature cache clear in translationsAction() before save()
    (save() already calls clearDependentCache() internally)
  • Remove unnecessary cache clear in exportAction()
    (export does not modify data, no cache invalidation needed)

@solverat solverat added this to the 1.3.2 milestone Mar 26, 2026
@solverat solverat requested a review from benwalch March 26, 2026 17:48
@solverat solverat self-assigned this Mar 26, 2026
@solverat solverat added the enhancement New feature or request label Mar 26, 2026
@solverat
Copy link
Copy Markdown
Contributor Author

Background: I had a painfull day of debugging zombie keys within a project with enabled Redis caching.

With Redis, writing a cache entry requires two separate operations: SETEX (write value) and SADD (register in tag set).

These are not atomic. If a second cache invalidation fires between these two operations, the tag registration is lost while the cache entry survives - a "zombie key" that can never be cleared by tag-based invalidation.

Removing the redundant clearDependentCache() call reduces the invalidation waves from two to one, which shrinks the window for this race condition to occur.

And as a final note: Whether this fully resolves the zombie key problem requires further observation in production.

@solverat solverat merged commit d4c308c into 1.x Mar 30, 2026
11 checks passed
@solverat solverat deleted the fix_translation_tag_clear branch March 30, 2026 07:56
@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants