Skia has proposed merging ~hyask/autopkgtest-cloud:skia/explicit_reject_msg
into autopkgtest-cloud:master.
Requested reviews:
Canonical's Ubuntu QA (canonical-ubuntu-qa)
For more details, see:
https://code.launchpad.net/~hyask/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/465143
This changes fixes the hanging on early return of `request` (bad message
format, upstream die roll, etc...).
--
Your team Canonical's Ubuntu QA is requested to review the proposed merge of
~hyask/autopkgtest-cloud:skia/explicit_reject_msg into autopkgtest-cloud:master.
diff --git a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker
index 1316336..eaabc36 100755
--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker
+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker
@@ -716,6 +716,7 @@ def request(msg):
"Upstream job detected and 1d100 rolled above %i, skipping for now",
worker_upstream_percentage,
)
+ msg.channel.basic_reject(msg.delivery_tag, requeue=True)
return
else:
logging.info(
@@ -729,6 +730,7 @@ def request(msg):
body = msg.body.decode("UTF-8")
except UnicodeDecodeError as e:
logging.error('Bad encoding in request "%s": %s', msg.body, e)
+ msg.channel.basic_ack(msg.delivery_tag)
return
# request is either a single string pkgname or "pkg_name json_params"
@@ -743,6 +745,7 @@ def request(msg):
logging.error(
'Received invalid request format "%s" (%s)', body, repr(e)
)
+ msg.channel.basic_ack(msg.delivery_tag)
return
test_uuid = params.get("uuid", str(uuid.uuid4()))
if not re.match("[a-zA-Z0-9.+-]+$", pkgname):
--
Mailing list: https://launchpad.net/~canonical-ubuntu-qa
Post to : [email protected]
Unsubscribe : https://launchpad.net/~canonical-ubuntu-qa
More help : https://help.launchpad.net/ListHelp