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:
Alexander Kukushkin
2015-09-18 12:41:36 +02:00
parent 8a0af6985f
commit afe1a2c92c
3 changed files with 5 additions and 0 deletions
+1
View File
@@ -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()
+1
View File
@@ -46,6 +46,7 @@ def calculate_ttl(expiration):
def sigterm_handler(signo, stack_frame):
signal.signal(signal.SIGTERM, signal.SIG_IGN)
sys.exit()
+3
View File
@@ -40,6 +40,9 @@ def keyboard_interrupt(*args):
class Mock_BaseServer__is_shut_down:
def wait(self):
pass
def set(self):
pass