Skip to content

Commit ad0105c

Browse files
authored
Merge pull request rails#54440 from byroot/cache-pool-timeout
Handle connection pool errors in Redis and Memcached stores
2 parents ae48231 + e9af1b7 commit ad0105c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

activesupport/lib/active_support/cache/mem_cache_store.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def deserialize_entry(payload, raw: false, **)
273273

274274
def rescue_error_with(fallback)
275275
yield
276-
rescue Dalli::DalliError => error
276+
rescue Dalli::DalliError, ConnectionPool::Error => error
277277
logger.error("DalliError (#{error}): #{error.message}") if logger
278278
ActiveSupport.error_reporter&.report(
279279
error,

activesupport/lib/active_support/cache/redis_cache_store.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def supports_expire_nx?
497497

498498
def failsafe(method, returning: nil)
499499
yield
500-
rescue ::Redis::BaseError => error
500+
rescue ::Redis::BaseError, ConnectionPool::Error => error
501501
@error_handler&.call(method: method, exception: error, returning: returning)
502502
returning
503503
end

0 commit comments

Comments
 (0)