From 69c1b8beca4089ab40f297193561d45b8d63cb30 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 10 Dec 2012 13:37:50 -0500 Subject: [PATCH] check_mirroring: Retry automatically on 'Detected server failure' errors. (imported from commit 2f834218bd492876749dd8953e522725935a7a1d) --- bots/check-mirroring | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bots/check-mirroring b/bots/check-mirroring index 5351013..143e25a 100755 --- a/bots/check-mirroring +++ b/bots/check-mirroring @@ -106,11 +106,16 @@ def send_humbug(message): logger.error(result) print_status_and_exit(1) -def send_zephyr(zwrite_args, content): +def send_zephyr(zwrite_args, content, retry=False): p = subprocess.Popen(zwrite_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = p.communicate(input=content.encode("utf-8")) if p.returncode != 0: + if not retry and "Detected server failure while receiving acknowledgement for" in stderr: + logger.warning("Got server failure error sending zephyr; retrying") + logger.warning(stderr) + # Retry sending the message rather than bailing. + return send_zephyr(zwrite_args, content, True) logger.error("Error sending zephyr:") logger.info(stdout) logger.error(stderr)