From 2919ce25444a2ece61e8ae8fcb483e9f27bed339 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 21 Dec 2012 11:42:54 -0500 Subject: [PATCH] zephyr_mirror: Cancel Zephyr subscriptions on graceful restart. (imported from commit 39737bbf7ea76181ab25a0eaacf230906cba3d87) --- bots/zephyr_mirror_backend.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py index 58e66e8..a9bbde4 100755 --- a/bots/zephyr_mirror_backend.py +++ b/bots/zephyr_mirror_backend.py @@ -218,6 +218,11 @@ def maybe_restart_mirroring_script(): except OSError: # We don't care if the child process no longer exists, so just print the error logging.exception("") + try: + zephyr._z.cancelSubs() + except IOError: + # We don't care whether we failed to cancel subs properly, but we should log it + logging.exception("") while True: try: os.execvp(os.path.join(options.root_path, "user_root", "zephyr_mirror_backend.py"), sys.argv)