Repository navigation
fix(background_tasks): warm the invalidation publish connection from the listener - #882
Merged
Merged
Conversation
…the listener The client's command connection opened lazily, so the first publish after boot or after an outage paid the connect inside its 1 s request-path budget and lost the message under load. The listener now PINGs after every successful SUBSCRIBE; a failed warm-up is logged at DEBUG and never restarts it. Closes #880 Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Deploying simple-module-python with
|
| Latest commit: |
d9e745f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d01f862f.simple-module-python.pages.dev |
| Branch Preview URL: | https://fix-issue-880-invalidation-c.simple-module-python.pages.dev |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Summary
Closes #880.
RedisInvalidationTransport.publishruns under a 1 sasyncio.timeout, while the request that made the write waits for its response. The client opened its command connection only on first use. So the first publish after boot, or after a Redis outage, also paid the TCP connect inside that second. Under load the connect was cancelled (seen in CI, #865) and the invalidation was lost; other workers kept the stale value until its TTL.PINGon the command client (_warm_publish_connection). That opens the pooled connection the next publish reuses.SUBSCRIBE_TIMEOUT_SECONDS. A failure is logged at DEBUG and never restarts the listener.start()still never waits on Redis.Design:
docs/superpowers/specs/2026-11-07-invalidation-warm-publish-design.md. Rejected alternatives:Verification
test_background_tasks_invalidation_warmup.py:CLIENT LISTshows the warmed connection, and a publish runs on that same connection without opening a new one. Connections are found by a per-testclient_name, because CI workers share one Redis.make lintgreen.make test-py: 8,204 passed, 28 skipped, with the Redis tests running.make test-js: 900 passed.https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4