canonical-ubuntu-qa team mailing list archive
-
canonical-ubuntu-qa team
-
Mailing list archive
-
Message #03629
[Merge] ~andersson123/autopkgtest-cloud:fix-amqp-status-collector into autopkgtest-cloud:master
Tim Andersson has proposed merging ~andersson123/autopkgtest-cloud:fix-amqp-status-collector into autopkgtest-cloud:master.
Requested reviews:
Canonical's Ubuntu QA (canonical-ubuntu-qa)
For more details, see:
https://code.launchpad.net/~andersson123/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/463658
--
Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~andersson123/autopkgtest-cloud:fix-amqp-status-collector into autopkgtest-cloud:master.
diff --git a/charms/focal/autopkgtest-web/units/amqp-status-collector.service b/charms/focal/autopkgtest-web/units/amqp-status-collector.service
index d0f75de..bfb92ae 100644
--- a/charms/focal/autopkgtest-web/units/amqp-status-collector.service
+++ b/charms/focal/autopkgtest-web/units/amqp-status-collector.service
@@ -5,6 +5,7 @@ StartLimitBurst=60
[Service]
RuntimeDirectory=amqp-status-collector
+RuntimeDirectoryPreserve=yes
ExecStart=/home/ubuntu/webcontrol/amqp-status-collector
Restart=on-failure
RestartSec=1s
diff --git a/charms/focal/autopkgtest-web/webcontrol/amqp-status-collector b/charms/focal/autopkgtest-web/webcontrol/amqp-status-collector
index 1169f2e..68aac9c 100755
--- a/charms/focal/autopkgtest-web/webcontrol/amqp-status-collector
+++ b/charms/focal/autopkgtest-web/webcontrol/amqp-status-collector
@@ -6,6 +6,7 @@ import json
import logging
import os
import socket
+import sys
import time
import urllib.parse
@@ -116,4 +117,11 @@ status_ch.queue_bind(queue_name, exchange_name, queue_name)
logging.info("Listening to requests on %s" % queue_name)
status_ch.basic_consume("", callback=process_message, no_ack=True)
while status_ch.callbacks:
- status_ch.wait()
+ try:
+ status_ch.wait()
+ except OSError as e:
+ if "Transport endpoint is not connected" in str(e):
+ logging.error(f"RabbitMQ is unresponsive: {str(e)}")
+ else:
+ logging.error(f"RabbitMQ callback failed with: {str(e)}")
+ sys.exit(1)