From 39f3e9b05ee5da20290c24808755a74e89253ee4 Mon Sep 17 00:00:00 2001 From: orlylevk Date: Thu, 1 May 2025 08:41:37 +0100 Subject: [PATCH 1/2] cleanup all dead connections --- lib/que/adapters/active_record_with_lock.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/que/adapters/active_record_with_lock.rb b/lib/que/adapters/active_record_with_lock.rb index f23ad21..5a9ccde 100644 --- a/lib/que/adapters/active_record_with_lock.rb +++ b/lib/que/adapters/active_record_with_lock.rb @@ -26,6 +26,9 @@ def initialize(job_connection_pool:, lock_connection_pool:) def checkout_activerecord_adapter(&block) checkout_lock_database_connection do @job_connection_pool.with_connection(&block) + rescue ::PG::Error, ::ActiveRecord::StatementInvalid => e + remove_dead_connections(e) + raise end end From a1fd557d16a4ce6bdb03c8efe75fba0b09af37b6 Mon Sep 17 00:00:00 2001 From: orlylevk Date: Fri, 2 May 2025 12:47:46 +0100 Subject: [PATCH 2/2] try getting CI tests to pass --- lib/que/adapters/active_record_with_lock.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/que/adapters/active_record_with_lock.rb b/lib/que/adapters/active_record_with_lock.rb index 5a9ccde..cdcb717 100644 --- a/lib/que/adapters/active_record_with_lock.rb +++ b/lib/que/adapters/active_record_with_lock.rb @@ -26,9 +26,9 @@ def initialize(job_connection_pool:, lock_connection_pool:) def checkout_activerecord_adapter(&block) checkout_lock_database_connection do @job_connection_pool.with_connection(&block) - rescue ::PG::Error, ::ActiveRecord::StatementInvalid => e - remove_dead_connections(e) - raise + # rescue ::PG::Error, ::ActiveRecord::StatementInvalid => e + # remove_dead_connections(e) + # raise end end