Repository navigation
DOC-7168 Add a connect page for redis-rs (Rust) - #4231
Merged
Merged
Conversation
New rust/connect.md covering sync and async basic connections (ACL user via URL and RedisConnectionInfo, Unix socket), cluster with replica read routing, Sentinel, TLS and mutual TLS with rustls, client-side caching, MultiplexedConnection sharing, ConnectionManager, r2d2 pools, timeouts, and protocol selection. Linked from rust/_index.md; Entra ID gets a one-line link to amr.md; smart client handoffs are left out. All 29 code blocks were built and run against local servers. Each block's crate used the page's own Cargo.toml lines verbatim, so the feature lists are proven minimal-and-sufficient. Test copies differed only in ports, hosts, passwords, cert paths and key names. Versions: redis 1.7.1 (pinned --precise), rustls 0.23.45, tokio 1.53.2, r2d2 0.8.10, Rust 1.90.0, Redis 7.2.7. Measured, not inferred: the 500 ms async response timeout fails BLPOP at ~502 ms and keeps timing out later commands on that multiplexed connection (and every clone) until the server finishes the block; the Sentinel get_connection() connection lost 22 and 21 acknowledged writes across a forced failover, since redis-rs never subscribes to +switch-master; the rustls provider panic happens with zero or two providers compiled in, so the mTLS example installs one explicitly. Learned: redis-rs async connections time out after 500 ms by default, which breaks long blocking commands Constraint: each Cargo.toml block lists exactly the features its snippet was built with; don't add features without rebuilding Rejected: bb8 example | second pool crate for already-multiplexed connections; integration verified in source only Rejected: #insecure and danger_accept_invalid_hostnames | need tls-rustls-insecure, and build_with_tls resets the hostname flag Rejected: copying the upstream sentinel.rs rustdoc examples | one passes a URL as a host, one builds a replica client with master_for Directive: the "Redis v7.4 or later" caching note is sibling-page house wording; caching actually ran on 7.2.7 Gaps: hostname-mismatch TLS not tested; deadpool-redis not covered; sync cluster caching not traced Recheck: Sentinel failover caveat if redis-rs adds a +switch-master listener or a Sentinel ConnectionManager Ticket: DOC-7168 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at e78a619 |
Contributor
kaitlynmichael
approved these changes
Oct 9, 2026
andy-stark-redis
added a commit
that referenced
this pull request
Oct 12, 2026
Adds a "Connect to Redis Sentinel" section after the cluster section on the nine connect.md pages (H3 on Jedis to match its neighbors). hiredis gets a short "not supported" section: v1.4.1 has no Sentinel code. Ruby and Rust had no connect pages; their Sentinel sections shipped with the new pages in DOC-7168 (#4230, #4231). Every snippet ran against a local topology (primary, replica, three Sentinels, mymaster, quorum 2) in two variants: no auth, and separate data-node and Sentinel passwords. Test copies differed from the page snippets only in ports, passwords, and key names. Versions run: redis-py 8.1.0 (GitHub tag source), go-redis v9.23.0, node-redis 6.3.0, ioredis 6.0.0, Jedis 8.0.2, Lettuce 7.8.0, StackExchange.Redis 3.0.0 (NuGet was blocked; latest is 3.3.1), Predis 3.6.1. The failover caveats are measured, not inferred. Under a forced SENTINEL FAILOVER, redis-py, ioredis (default options), a Lettuce RedisClient connection, Predis, and SE.Redis 3.0.0 kept writing to the demoted primary for about 10 s, until Sentinel reconfigured it, and the old primary discarded those acknowledged writes on resync (22 of about 60 in the measured runs). go-redis, node-redis, and Jedis subscribe to +switch-master and moved within 1-2 s; ioredis with failoverDetector cut loss to the inherent sub-second window. The .NET page deliberately has no caveat: 3.3.1 adds an IsStalePrimaryView path that may close the window, and 3.3.1 couldn't be run here (needs the .NET 10 SDK). Surprises worth knowing before editing these sections: Jedis RedisSentinelClient has no replica reads at all; Predis replica routing is sticky until the first write and the parameters username leaks to the Sentinels (hence username in each Sentinel URI); go-redis ReplicaOnly sends writes to the replica too; redis-py sentinel_kwargs stops socket_* inheritance. Learned: five of the eight clients on these pages silently lose ~10 s of writes after a graceful Sentinel failover Constraint: every snippet here is run-verified (some trimmed to fragments of the tested program); re-run any edit against a real Sentinel topology Rejected: SE.Redis SentinelUser/SentinelPassword options | 3.1.13+, source-read only, never run; page uses SentinelConnect + GetSentinelMasterConnection, which ran on 3.0.0 Rejected: Jedis .serverDefaultProtocol() to silence the 8.x RESP3 WARN | method doesn't exist in 7.x Directive: add the SE.Redis failover caveat only after testing 3.3.1 or later under a forced failover Directive: link the go-redis and Lettuce Sentinel URL forms to connection-urls.md once DOC-7165 (#4228) merges Gaps: no TLS to Sentinels tested on any client; no crash failover, only graceful SENTINEL FAILOVER; SE.Redis 3.3.1 never run Recheck: SE.Redis credentials example when the .NET 10 SDK is available to run 3.3.1 Ticket: DOC-7167 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds a connect page for redis-rs, the only Rust client page without one, and links it from
rust/_index.md. Part of DOC-7168 (epic DOC-7164). The Ruby page is in a separate PR.What's on the page
RedisConnectionInfo), and a Unix socketMultiplexedConnection,ConnectionManager, and r2d2 poolsredis-rs doesn't support smart client handoffs, so the page leaves them out.
How the examples were tested
All 29 code blocks were built and run against local servers:
Each code block was built using only the
Cargo.tomlfeatures shown next to it, which proves the feature lists are correct. The test copies differed from the page only in ports, hosts, passwords, certificate paths and key names.Please review these points
BLPOPthat waits longer fails after about half a second. Later commands on the same connection, and on every copy of it, also time out until the server finishes theBLPOP. The page explains this and shows how to change the timeout.Not changed
The existing Rust pages still pin
redis = "1.0.4", while this page uses 1.7.1. Updating them is a follow-up.🤖 Generated with Claude Code
Note
Low Risk
Documentation-only changes with no runtime or security logic; operational caveats are descriptive rather than altering product behavior.
Overview
Adds the missing Connect to the server doc for
redis-rsand links it from the Rust client landing page so readers can find cluster, Sentinel, and TLS setup after the basic examples.The new
connect.mddocuments sync/async connections (URLs, ACL/RedisConnectionInfo, Unix sockets), Redis Cluster (including replica read routing), Sentinel (split credentials, master vs replica, and explicit failover caveats about stale connections and possible lost writes), TLS with rustls/mTLS, experimental client-side caching (RESP3/async only), connection management (MultiplexedConnection,ConnectionManager, r2d2), timeouts (including the default 500 ms async response timeout vs blocking commands likeBLPOP), and RESP2/RESP3 selection. Examples pinredis = "1.7.1"; the landing page still references1.0.4(called out as follow-up).Reviewed by Cursor Bugbot for commit e78a619. Bugbot is set up for automated code reviews on this repo. Configure here.