summaryrefslogtreecommitdiff
path: root/python/walmgr.py
diff options
context:
space:
mode:
authorMarko Kreen2008-03-13 14:50:33 +0000
committerMarko Kreen2008-03-13 14:50:33 +0000
commit915acc3c4f480588a1e3015a7b474206d4de5ee0 (patch)
treeac7b0efcf52452c2b976cc6974138de659f20c8a /python/walmgr.py
parent30bd668ff3eb2802bc27083394da94eaea973af5 (diff)
detect postgres death in recovery
Diffstat (limited to 'python/walmgr.py')
-rwxr-xr-xpython/walmgr.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/walmgr.py b/python/walmgr.py
index 7b3c07b1..a26472f5 100755
--- a/python/walmgr.py
+++ b/python/walmgr.py
@@ -890,6 +890,15 @@ class WalMgr(skytools.DBScript):
self.log.info("%s: not found, stopping" % srcname)
sys.exit(1)
+ # nothing to do, just in case check if parent is alive
+ try:
+ os.kill(os.getppid(), 0)
+ except OSError, ex:
+ if ex.errno == errno.ESRCH:
+ self.log.info("%s: not found, stopping" % srcname)
+ sys.exit(1)
+ self.log.warning("Parent aliveness check failed: "+str(ex))
+
# nothing to do, sleep
self.log.debug("%s: not found, sleeping" % srcname)
time.sleep(1)