Repository navigation
Conversation
Prepared with OpenAI Codex assistance; account-owner review is pending.
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.
Closing a
PubSubBroker.listen()generator previously left the Redis subscription and its dedicated pool connection checked out. After one listener ended, a broker with a single-connection pool could no longer publish or open a replacement listener (ConnectionError: No connection available). Cancellation and a failed receive leaked the slot too. The listener now owns the PubSub object through its async context manager, so it disconnects and releases the slot on every exit before the surrounding Redis client exits.Fixes #143. Assignment has been requested; the issue is not yet assigned. This is limited to PubSub listener resource ownership and does not change delivery guarantees, retries, Redis Streams, or the public API.
Actual local verification on Windows 11, Python 3.14.7, taskiq 0.13.0, redis-py 8.0.0, and an isolated Redis 5.0.14.1 over TCP/RESP2:
8f70bc85dd6a469cae7d3b467af7dea720c92434because the nextbroker.kick()cannot acquire a connection; all three pass with the fix. They cover generator close, cancellation while waiting, and a server-sideCLIENT KILLof the test-owned connection, then verify publishing and receiving through a replacement listener.uv run --frozen pytest tests/test_pubsub_cleanup.py tests/test_broker.py -k 'pubsub or (pub_sub and not sentinel)' -q: 5 passed, 13 deselected, including the existing broadcast and connection-limit tests.uv run --frozen prek run --files taskiq_redis/redis_broker.py tests/test_pubsub_cleanup.py: all applicable hooks passed, including repository-wide Ruff and mypy (16 source files), and Black on the changed files.git diff --checkpassed.The real Redis checks exercise broker methods, connections and wire behavior, not a full Taskiq worker process. Sentinel, Cluster, Streams, the full runtime suite, and the Python/OS matrix were not run locally; those remain CI work. RESP2 was explicitly selected because the locally available Redis 5 server does not support RESP3.
Prepared with OpenAI Codex assistance for investigation, implementation, tests and this description. This PR is intentionally a draft pending independent review and account-owner review; no human review is claimed.