Repository navigation
Fix cancelled native StreamReader waiters and preserve buffered data - #107
Merged
Merged
Conversation
Add all 10 missing profiling hooks after the merge. Capture native test output to regular files to avoid Windows MSYS pipe aborts while preserving exit status and full logs.
Check private reader/transport identity only for rsloop. Retain encrypted round trips, EOF, writer transport replacement and server shutdown assertions for every backend.
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.
Fixes #106.
A cancelled native stream read leaves its Future registered in ReadWaiter. Retrying before data arrives raises the concurrent-reader ValueError; later feeds can instead consume and discard bytes for the cancelled Future. Fragmented readexactly() additionally owns bytes in a private accumulator.
This change:
Adds differential cancellation/timeout/retry/EOF/error tests on asyncio, rsloop and uvloop; a real private Redis server integration test for redis-py 5.3.1 + hiredis (SET/GET, both pipeline modes, connection reuse and PING); a Linux CI job; a reproducible benchmark. Updates an existing regression that incorrectly expected cancelled exact reads to lose bytes.
Actual local validation
Linux x86_64, CPython 3.14.7, nightly-2026-09-25, default-feature release extension, Redis 7.2.5, redis-py 5.3.1, hiredis 3.4.2, uvloop 0.23.0.
The full suites did not pass in this environment. Network tests exercised mio/epoll fallback. Actual io_uring, macOS, Windows, other Python versions and free-threaded Python were not validated locally; CI remains a separate gate.
Performance tradeoff
Same-toolchain release builds, baseline/fix/fix/baseline, CPU-pinned lifecycle benchmark:
CI follow-up (2026-10-10)
Merged master at 439d288, preserving the existing PR commits and file removals.
Local follow-up validation:
On GitHub Actions, run 94 passed the standard profiling job, Windows native/isolated-feature job, both Rust suites and Redis integration. It exposed the older-asyncio assertion fixed in the final commit. The allocation-profile job was cancelled when that commit started run 95; final CI results are pending.