mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Don't wait until the previous callback finish is kill failed (#1036)
Such wait was happening in the main thread and blocking HA loop. After all the executor thread was doing absolutely the same.
This commit is contained in:
@@ -24,8 +24,6 @@ class CallbackExecutor(Thread):
|
||||
logger.warning('Killed the old callback process because it was still running: %s', self._cmd)
|
||||
except OSError:
|
||||
logger.exception('Failed to kill the old callback')
|
||||
logger.warning('Wait until callback end')
|
||||
self._process.wait()
|
||||
self._cmd = cmd
|
||||
self._callback_event.set()
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class TestCallbackExecutor(unittest.TestCase):
|
||||
self.assertIsNone(ce.call([]))
|
||||
|
||||
mock_popen.return_value.kill.side_effect = OSError
|
||||
self.assertRaises(Exception, ce.call, [])
|
||||
self.assertIsNone(ce.call([]))
|
||||
|
||||
mock_popen.side_effect = Exception
|
||||
ce = CallbackExecutor()
|
||||
|
||||
Reference in New Issue
Block a user