From d06af14c26dcf89c6fe8b59782799ffd89bf5db7 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 11 Jun 2018 15:10:28 +0800 Subject: [PATCH] FIX: Notify all processes to fallback when PostgreSQL recovers. --- .../connection_adapters/postgresql_fallback_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb index f2ab2247e33..24fa8260a0d 100644 --- a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb +++ b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb @@ -72,7 +72,7 @@ class PostgreSQLFallbackHandler if is_connection_active logger.warn "#{log_prefix}: Master server is active. Reconnecting..." - clear_connections + MessageBus.publish(DATABASE_DOWN_CHANNEL, db: namespace) self.master_up(key) disable_readonly_mode Sidekiq.unpause!