zephyr_mirror: Don't leak zephyr_mirror processes on send_humbug failures.
(imported from commit be005018672369683d9e3bdbf144f96f58af6b6c)
This commit is contained in:
parent
074316105b
commit
18bbd02074
|
@ -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.
|
||||||
|
try:
|
||||||
res = send_humbug(zeph)
|
res = send_humbug(zeph)
|
||||||
if res.get("result") != "success":
|
if res.get("result") != "success":
|
||||||
logger.error("Error relaying zephyr:\n%s\n%s" % (zeph, res))
|
logger.error("Error relaying zephyr:\n%s\n%s" % (zeph, res))
|
||||||
sys.exit(0)
|
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():
|
||||||
|
|
Loading…
Reference in a new issue