Skip to content

Fix flaky cluster test_recycled by using pool object ID#466

Merged
bikeshedder merged 2 commits intodeadpool-rs:mainfrom
bombsimon:fix/flaky-redis-cluster-test
Feb 19, 2026
Merged

Fix flaky cluster test_recycled by using pool object ID#466
bikeshedder merged 2 commits intodeadpool-rs:mainfrom
bombsimon:fix/flaky-redis-cluster-test

Conversation

@bombsimon
Copy link
Contributor

CLIENT SETNAME/GETNAME are per-TCP-connection commands. In a cluster, ClusterConnection manages multiple internal TCP connections (one per node). redis-rs routes CLIENT SETNAME to all nodes but CLIENT GETNAME to a random single node, so GETNAME can return None if it hits a different node than expected.

Instead, use deadpool's Object::id() to verify recycling at the pool level. This is deterministic and doesn't depend on Redis cluster command routing.

Also expose id() and metrics() on the cluster Connection wrapper.

Fixes #465

bombsimon and others added 2 commits February 18, 2026 17:15
`CLIENT SETNAME`/`GETNAME` are per-TCP-connection commands. In a cluster,
`ClusterConnection` manages multiple internal TCP connections (one per
node). redis-rs routes `CLIENT SETNAME` to all nodes but `CLIENT GETNAME`
to a random single node, so `GETNAME` can return `None` if it hits a
different node than expected.

Instead, use deadpool's `Object::id()` to verify recycling at the pool
level. This is deterministic and doesn't depend on Redis cluster
command routing.

Also expose `id()` and `metrics()` on the cluster `Connection` wrapper.

Fixes #465

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bombsimon
Copy link
Contributor Author

Right when we talked about AI, sorry for not double checking clippy 🤦

@bikeshedder
Copy link
Collaborator

Awesome. Thanks a lot! ❤️

@bikeshedder bikeshedder merged commit 8db4b26 into deadpool-rs:main Feb 19, 2026
16 checks passed
@bombsimon bombsimon deleted the fix/flaky-redis-cluster-test branch February 19, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

redis cluster test test_recycled fails sometimes

2 participants

Comments