Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/funny-laws-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/caching-redis": patch
---

fix(caching-redis): surface redis connection failures during cache operations
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ export class RedisCachingProvider {
} catch (error) {
if (this.isConnectionError(error)) {
this.logger.warn(
"Redis connection error during get operation, returning null to trigger fallback to original data source"
`[redis-cache] Redis connection error during get operation, returning empty array to trigger fallback to original data source. Error: ${
error?.message ?? error
}`
)
return null
}
Expand Down Expand Up @@ -348,7 +350,7 @@ export class RedisCachingProvider {
return JSON.parse(finalData)
} catch (e) {
// If JSON parsing fails, skip this entry (corrupted data)
this.logger.warn(`Skipping corrupted cache entry: ${e.message}`)
this.logger.warn(`[redis-cache] Skipping corrupted cache entry: ${e.message}`)
return null
}
}
Expand All @@ -363,7 +365,9 @@ export class RedisCachingProvider {
} catch (error) {
if (this.isConnectionError(error)) {
this.logger.warn(
"Redis connection error during get operation, returning empty array to trigger fallback to original data source"
`[redis-cache] Redis connection error during get operation, returning empty array to trigger fallback to original data source. Error: ${
error?.message ?? error
}`
)
return null
}
Expand Down Expand Up @@ -440,7 +444,9 @@ export class RedisCachingProvider {
} catch (error) {
if (this.isConnectionError(error)) {
this.logger.warn(
"Redis connection error during set operation, relying on IORedis retry mechanism"
`[redis-cache] Redis connection error during set operation, relying on IORedis retry mechanism. Error: ${
error?.message ?? error
}`
)
return
}
Expand Down Expand Up @@ -683,7 +689,9 @@ export class RedisCachingProvider {
} catch (error) {
if (this.isConnectionError(error)) {
this.logger.warn(
"Redis connection error during clear operation, relying on IORedis retry mechanism"
`[redis-cache] Redis connection error during clear operation, relying on IORedis retry mechanism. Error: ${
error?.message ?? error
}`
)
return
}
Expand Down Expand Up @@ -716,7 +724,9 @@ export class RedisCachingProvider {
} catch (error) {
if (this.isConnectionError(error)) {
this.logger.warn(
"Redis connection error during flush operation, relying on IORedis retry mechanism"
`[redis-cache] Redis connection error during flush operation, relying on IORedis retry mechanism. Error: ${
error?.message ?? error
}`
)
return
}
Expand Down
Loading