diff options
| author | Marko Kreen | 2008-03-13 14:50:33 +0000 |
|---|---|---|
| committer | Marko Kreen | 2008-03-13 14:50:33 +0000 |
| commit | 915acc3c4f480588a1e3015a7b474206d4de5ee0 (patch) | |
| tree | ac7b0efcf52452c2b976cc6974138de659f20c8a /python | |
| parent | 30bd668ff3eb2802bc27083394da94eaea973af5 (diff) | |
detect postgres death in recovery
Diffstat (limited to 'python')
| -rwxr-xr-x | python/walmgr.py | 9 |
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) |
