zephyr_mirror: Cancel Zephyr subscriptions on graceful restart.

(imported from commit 39737bbf7ea76181ab25a0eaacf230906cba3d87)
This commit is contained in:
Tim Abbott 2012-12-21 11:42:54 -05:00
parent 25bb86d2d0
commit 2919ce2544

View file

@ -218,6 +218,11 @@ def maybe_restart_mirroring_script():
except OSError: except OSError:
# We don't care if the child process no longer exists, so just print the error # We don't care if the child process no longer exists, so just print the error
logging.exception("") 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: while True:
try: try:
os.execvp(os.path.join(options.root_path, "user_root", "zephyr_mirror_backend.py"), sys.argv) os.execvp(os.path.join(options.root_path, "user_root", "zephyr_mirror_backend.py"), sys.argv)