mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
During shutdown sigterm is send to all processes every second
First time is triggers some shutdown mechanisms in a patroni, but the second one just terminates patroni. Solution is pretty simple, we need to ignore all other sigterms which are coming after the first one.
This commit is contained in:
@@ -126,6 +126,7 @@ def main():
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
finally:
|
||||
patroni.api.shutdown()
|
||||
patroni.touch_member(patroni.shutdown_member_ttl) # schedule member removal
|
||||
patroni.postgresql.stop()
|
||||
patroni.ha.dcs.delete_leader()
|
||||
|
||||
@@ -46,6 +46,7 @@ def calculate_ttl(expiration):
|
||||
|
||||
|
||||
def sigterm_handler(signo, stack_frame):
|
||||
signal.signal(signal.SIGTERM, signal.SIG_IGN)
|
||||
sys.exit()
|
||||
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@ def keyboard_interrupt(*args):
|
||||
|
||||
class Mock_BaseServer__is_shut_down:
|
||||
|
||||
def wait(self):
|
||||
pass
|
||||
|
||||
def set(self):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user