← Back to team overview

canonical-ubuntu-qa team mailing list archive

[Merge] ~andersson123/autopkgtest-cloud:fix-systemd-stop-restart-losing-jobs into autopkgtest-cloud:master

 

Tim Andersson has proposed merging ~andersson123/autopkgtest-cloud:fix-systemd-stop-restart-losing-jobs into autopkgtest-cloud:master.

Requested reviews:
  Canonical's Ubuntu QA (canonical-ubuntu-qa)
Related bugs:
  Bug #2067714 in Auto Package Testing: "systemctl restart autopkgtest@*.service still looses jobs"
  https://bugs.launchpad.net/auto-package-testing/+bug/2067714

For more details, see:
https://code.launchpad.net/~andersson123/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/466850
-- 
Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~andersson123/autopkgtest-cloud:fix-systemd-stop-restart-losing-jobs 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 2467a8b..32c8661 100755
--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker
+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker
@@ -1367,33 +1367,26 @@ def request(msg):
                     # tests can be requested to be killed with:
                     # kill -15 $pid
                     logging.warning(
-                        "autopkgtest exited with code: %i",
+                        "autopkgtest exited with code: %i\nack-ing message: %s",
                         code,
+                        body.encode(),
                     )
                     running_test = False
                     # we ack the message so it doesn't go back in the queue
-                    if code == -15:
+                    if exit_requested is not None:
                         logging.info(
-                            "autopkgtest has been killed with SIGTERM, indicating a restart or stop, requeue-ing message %s"
-                            % body
+                            "An exit has been requested via systemd, placing message %s back in queue",
+                            body.encode(),
                         )
                         msg.channel.basic_reject(
                             msg.delivery_tag, requeue=True
                         )
-                    elif code == -9:
-                        logging.info(
-                            "autopkgtest has been killed intentionally, removing message %s from the queue"
-                            % body
-                        )
-                        msg.channel.basic_ack(msg.delivery_tag)
                     else:
-                        logging.info(
-                            "autopkgtest has hit an obscure failure mode, removing message %s from the queue"
-                            % body
-                        )
-                        msg.channel.basic_reject(
-                            msg.delivery_tag, requeue=True
+                        logging.warning(
+                            "autopkgtest failure not requested via systemd, removing message %s from queue",
+                            body.encode(),
                         )
+                        msg.channel.basic_ack(msg.delivery_tag)
                     logging.info(
                         "Killing openstack server with uuid %s",
                         test_uuid,
diff --git a/docs/administration.rst b/docs/administration.rst
index 2171554..9f3fe30 100644
--- a/docs/administration.rst
+++ b/docs/administration.rst
@@ -485,9 +485,6 @@ In order to kill a currently running test, grab the test uuid. This can be seen 
 
   ps aux | grep runner | grep $uuid
   # grab the PID from the process
-  # If you want to kill the test and remove the test request from the queue:
-  kill -9 $pid
-  # If you want to kill the test and preserve the test request in the queue:
   kill -15 $pid
 
 This will kill the autopkgtest process, and then the worker will `ack` the test request
diff --git a/mojo/service-bundle b/mojo/service-bundle
index cfa2d0a..df9cc07 100644
--- a/mojo/service-bundle
+++ b/mojo/service-bundle
@@ -171,7 +171,7 @@ applications:
                 10.145.243.183: 3  #  lxd-armhf-bos03-13  @  ps6-ra2-arm64-n1
                 10.145.243.141: 3  #  lxd-armhf-bos03-14  @  ps6-rb1-arm64-n1
                 10.145.243.70:  3  #  lxd-armhf-bos03-15  @  ps6-rb1-arm64-n1
-                10.145.243.42:  3  #  lxd-armhf-bos03-16  @  ps6-ra4-arm64-n1
+                10.145.243.21:  3  #  lxd-armhf-bos03-16  @  ps6-rb1-arm64-n1
 {%- elif stage_name == "staging" %}
             lxd-remotes: |-
               armhf:

References