feat: enforce per-use-case Redis read deadlines#83
Open
lan17 wants to merge 1 commit into
Open
Conversation
lan17
marked this pull request as ready for review
July 24, 2026 03:18
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.
Summary
RedisConfig.readTimeoutMsand support staticCachedOptions.redisReadTimeoutMsoverridesAbortSignalRedisReadContextplusRedisReadTimeoutErrorWhy
Redis fail-open behavior was rejection-driven, so a read promise that never settled retained the process flight and prevented the source fallback from starting. A rejected untracked read also proceeded to a Redis write after fallback, exposing one invocation to the unhealthy client twice. The core now bounds caller-visible read waiting while leaving underlying resource lifetime to finite client-native budgets.
Compatibility
This is a deliberate pre-1.0 configuration change: every Redis-enabled
DialCacheinstance must now provide a positive finitereadTimeoutMs. Custom one-argumentDialCacheRedisClient.read(request)implementations remain structurally compatible because the new read context is optional.Validation
corepack pnpm check— typecheck, 266 unit tests with coverage, ESM/CJS build and declarations, packed-consumer checkscorepack pnpm test:integration— 69 Redis 6.2, Valkey 8, and Redis Cluster casescorepack pnpm benchmark:request-local— default 50,000-iteration / 1,000-follower matrix; Redis fan-out asserted one semantic read, one deadline timer, and one timer clearcorepack pnpm audit --prod --audit-level high— no known vulnerabilitiesgit diff --checkCloses #38