Repository navigation
feat: enforce runtime-configurable remote read deadlines - #83
Merged
Merged
Conversation
lan17
marked this pull request as ready for review
July 24, 2026 03:18
lan17
force-pushed
the
agent/redis-read-deadlines
branch
from
July 25, 2026 22:23
9e60cdf to
5c155e4
Compare
lan17
force-pushed
the
agent/redis-read-deadlines
branch
from
July 25, 2026 22:57
5c155e4 to
d32847b
Compare
This was referenced Jul 25, 2026
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 per-use-case static/runtime policy throughDialCacheKeyConfig.remoteReadTimeoutMsdefaultConfig→ instance Redis config → 50 msAbortSignalcache_read_timeout; other read failures remaincache_readcached()andgetOrLoad()Public API
RedisConfig.readTimeoutMs?: numberDialCacheKeyConfig.remoteReadTimeoutMs?: numberRedisReadContext { timeoutMs, signal }as the optional second argument toDialCacheRedisClient.read()RedisReadTimeoutErrorMetricErrorKindadds"cache_read_timeout"There is no new option on
CachedOptions; per-use-case policy stays in the existing runtime-config abstraction. Existing one-argument custom Redis clients remain structurally compatible.Semantics
The deadline bounds caller wait and cache publication, not guaranteed server-side cancellation. Same-key followers share the active leader’s remaining budget.
fallbackTimeoutMsstarts separately only when the source loader begins. Writes, invalidations, serializers, config providers, and underlying client resource lifetime remain application-owned.Explicit timeout values must be positive safe integers no greater than 2,147,483,647. An invalid runtime value is a config-resolution failure: the invocation runs the source uncached without attempting Redis.
Review loop
A three-reviewer discovery round covered correctness/concurrency, API/observability, and tests/package/performance. It found one P2: a custom client that synchronously exceeded the deadline and then threw was classified as
cache_readinstead ofcache_read_timeout. Follow-up commitd32847bnormalizes invocation through the monotonic promise path and adds paired over-deadline synchronous return/throw regressions.The branch was also rebased onto
mainafter PR #88 merged. A brand-new confirmation reviewer then inspected the complete rebased tree and returned no P0–P3 findings, explicitly verifying that the derived watermark-TTL behavior remains intact.Validation
corepack pnpm check— typecheck, 278 unit tests with 96.77% statement / 92.94% branch coverage, ESM/CJS build and declarations, packed-consumer checkscorepack pnpm test:integration— 73 Redis 6.2, Valkey 8, and Redis Cluster casescorepack pnpm benchmark:request-local— six-scenario default matrix; 1,000 coalesced callers asserted one semantic Redis read and one deadline timercorepack pnpm audit --prod --audit-level high— no known production vulnerabilitiesgit diff --checkmain(615c31fef702ec141396413a6f16b4d6c78fa06a) is an ancestor of this headCloses #38