(POOLER-156) Detect redis connection failures

This commit adds detection for redis connection failures to pool_manager. When a connection fails the error will be raised to executeforcing the connection to be re-established. Without this change, when a redis connection fails, it generates a redis connection error, which is swallowed by a rescue for StandardError, preventing the manager application component from recovering in the case of a redis connection failure.
This commit is contained in:
kirby@puppetlabs.com 2020-03-17 11:16:18 -07:00
parent d653ce482e
commit 283dea62a7
2 changed files with 27 additions and 0 deletions

View file

@ -822,6 +822,8 @@ module Vmpooler
loop_count += 1
end
end
rescue Redis::CannotConnectError => e
raise
rescue StandardError => e
$logger.log('s', "[!] [#{pool['name']}] Error while checking the pool: #{e}")
raise
@ -1310,6 +1312,9 @@ module Vmpooler
loop_count += 1
end
end
rescue Redis::CannotConnectError => e
$logger.log('s', "Cannot connect to the redis server: #{e}")
raise
end
end
end