Redis calls time out instead of hanging a request; notify stops at a dead broker (#841) #1002
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/841-redis-timeouts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two of #841's follow-ups. The blocking-loop part was fixed in #850 and is not touched here. Refs #841 (not closing it: see the end).
1. Redis clients have timeouts
A paused or unreachable Redis used to leave the request that touched it waiting for ever. It didn't block the event loop, but it never answered.
app/redis_pool.pynow holds the timeouts in one place: 2 s to connect, 10 s for a reply. The shared pool uses them, and a newadhoc_client()replaces every hand-builtaioredis.from_url(...)(/ready, the names cache, the relationship-proposal helpers, the workbench pool, the planning tasks). The sync pool inbot_pubsubuses them too.get_message(timeout=30)), which now usesblocking_client(). The backend has no consumer of the bot-notify stream; it only adds to it./readyanswers 503 naming Redis (and now closes its client when the ping fails), the cache helpers fall through, and the sites that raised still raise.app/builds a Redis client from the URL without the timeouts.2.
notify()stops at a dead brokerWith the broker unreachable, each recipient's publish cost its own timeout, one after another. Now the first connectivity failure in a
notify()call skips the rest of that batch and logs once how many were skipped.Not in this PR
The backend's
mem_limitand uvicorn's worker health-check timeout, which are the owner's call. The worker kills #841 was opened for have not been seen since the CI runner's capacity was raised; #841 stays open for that decision.Checked
tests/test_redis_timeouts.py,tests/export,tests/wiki, 616 passed.🤖 Generated with Claude Code