Repository navigation
fix(invalidation): throttle the listener's reconnect WARNING to one a minute (LAB-7638) - #482
Conversation
… minute (LAB-7638) While Redis is unreachable the listener fails once a second, and each failure logged a WARNING. Route it through a _WarnThrottle like the module's other background failures: one WARNING a minute per process with the count since the last one, DEBUG in between. The 1 s retry is unchanged. Also: document the throttled WARNING and the silently dead connection case, list CACHEKIT_INVALIDATION_LISTENER_ENABLED in configuration.md, close the restricted client in the ACL tests' finally blocks, and drop three tests that duplicate coverage elsewhere.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. Summary by CodeRabbit
WalkthroughThe invalidation listener now rate-limits connection-error warnings and includes the error count in each warning. It logs intervening errors at DEBUG and continues retrying every second. Documentation and tests describe or check the warning behaviour, and ACL integration tests close restricted clients only when creation succeeds. ChangesInvalidation listener updates
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The change bounds repeated warning noise without changing the retry cadence, and the supplied evidence identifies no issue that needs resolution before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 3 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
What
While Redis is unreachable or rejects AUTH, the invalidation listener fails once a second, and each failure logged a WARNING
Invalidation listener error; retrying in 1 s. A long outage across many workers made that a log flood. The branch now goes through a_WarnThrottle, as the module's publish and dropped-event failures already do: one WARNING a minute per process,Invalidation listener error (errors since the last warning: N), with DEBUG in between. The 1 s retry and theResponseError(refused subscription) branch are unchanged.Also in this PR
docs/features/l1-invalidation.md: the Delivery bullet and the troubleshooting entry describe the throttled WARNING; the "No WARNING" list adds the silently dead connection case the Delivery bullet already documents.docs/configuration.md: listsCACHEKIT_INVALIDATION_LISTENER_ENABLEDwith a link to Cross-Process L1 Eviction.tests/integration/test_invalidation_channel_redis.py: the ACL tests close the restricted client infinally, so a failing assertion no longer leaves it open.tests/unit/test_invalidation_listener.py: newtest_connection_errors_warn_once_a_window_with_the_count(fails with the throttle removed). Removed three tests whose coverage lives elsewhere:TestSWRRefreshAfterEviction(within-TTL SWR runs only in L1-only mode, where no listener registers;test_object_cache.pycovers the guard),test_flag_reads_the_environment, and thepy-call-osafterforkcase oftest_import_warns_once(covered bytest_any_fork_option_silences_it).Testing
ruff check,ruff format --check, basedpyright,pytest tests/unit tests/critical -m "not slow"(4571 passed),tests/integration/test_invalidation_channel_redis.pyagainst a live Redis (18 passed), doctests,tests/docs/and--markdown-docs README.md docs/.Closes LAB-7638