zephyr_mirror: Don't leak zephyr_mirror processes on send_humbug failures.

(imported from commit be005018672369683d9e3bdbf144f96f58af6b6c)
This commit is contained in:
Tim Abbott 2012-11-29 08:57:25 -05:00
parent 074316105b
commit 18bbd02074

View file

@ -340,10 +340,14 @@ def process_notice(notice, log):
if os.fork() == 0: if os.fork() == 0:
# Actually send the message in a child process, to avoid blocking. # Actually send the message in a child process, to avoid blocking.
res = send_humbug(zeph) try:
if res.get("result") != "success": res = send_humbug(zeph)
logger.error("Error relaying zephyr:\n%s\n%s" % (zeph, res)) if res.get("result") != "success":
sys.exit(0) logger.error("Error relaying zephyr:\n%s\n%s" % (zeph, res))
except Exception:
logging.exception("Error relaying zephyr:")
finally:
os._exit(0)
def decode_unicode_byte_strings(zeph): def decode_unicode_byte_strings(zeph):
for field in zeph.keys(): for field in zeph.keys():