mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Do not hide environment variables
* Serialize callback execution. If the previous callback is still running - kill it Also it will fix a problem of zombie processes when executing callbacks from the main thread. * bugfix: pass an arguments to a callback
This commit is contained in:
committed by
Oleksii Kliukin
parent
a5e79bce9d
commit
663bbb1048
@@ -1,5 +1,4 @@
|
||||
import logging
|
||||
import os
|
||||
import subprocess
|
||||
from threading import Event, Lock, Thread
|
||||
|
||||
@@ -31,7 +30,7 @@ class CallbackExecutor(Thread):
|
||||
self._callback_event.clear()
|
||||
with self._lock:
|
||||
try:
|
||||
self._process = subprocess.Popen(self._cmd, close_fds=True, env={'PATH': os.environ.get('PATH')})
|
||||
self._process = subprocess.Popen(self._cmd, close_fds=True)
|
||||
except Exception:
|
||||
logger.exception('Failed to execute %s', self._cmd)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user