fix: treat Redis GET abort/timeout as cache miss (reduce log spam)#65
Draft
fix: treat Redis GET abort/timeout as cache miss (reduce log spam)#65
Conversation
Coverage ReportCoverage after merging
|
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.
Closes #57.
Problem
On fresh deployments (often with a new
keyPrefix) the cache is effectively empty and the first requests are expected to miss.However, we also observed noisy
console.errorlogs in production when RedisGETis aborted due to the handler's own timeout (AbortSignal.timeout(getTimeoutMs)).This is an expected fallback behavior of this cache handler (it prefers rendering over blocking on Redis), but it previously produced error-level logs via
redisErrorHandler().What this PR changes
GETabort/timeout as a cache miss: if the redis client rejects withAbortError/ABORT_ERR, we returnnullwithout passing the error intoredisErrorHandler().redisErrorHandler()and are logged asconsole.error.Why this does not hide real errors
null(no exception) and is already handled.Tests
GETand asserts:RedisStringsHandler.get()returnsnullconsole.erroris not calledNotes / follow-ups
If we want observability for timeout frequency without log floods, we can add an optional/sampled timeout logger or metric counter in a follow-up PR.