Tim Andersson has proposed merging 
~andersson123/autopkgtest-cloud:worker-dont-remove-queue-item-systemctl-restart 
into autopkgtest-cloud:master.

Requested reviews:
  Canonical's Ubuntu QA (canonical-ubuntu-qa)
Related bugs:
  Bug #2064582 in Auto Package Testing: "sudo systemctl restart 
autopkgtest.target loses currently running jobs  with new kill test changes"
  https://bugs.launchpad.net/auto-package-testing/+bug/2064582

For more details, see:
https://code.launchpad.net/~andersson123/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/465424
-- 
Your team Canonical's Ubuntu QA is requested to review the proposed merge of 
~andersson123/autopkgtest-cloud:worker-dont-remove-queue-item-systemctl-restart 
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 af3b906..0978612 100755
--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker
+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker
@@ -1333,7 +1333,17 @@ def request(msg):
                     )
                     running_test = False
                     # we ack the message so it doesn't go back in the queue
-                    msg.channel.basic_ack(msg.delivery_tag)
+                    if code == -15:
+                        logging.info(
+                            "autopkgtest has been killed with USR1, indicating a restart, not removing message %s from queue"
+                            % body
+                        )
+                    else:
+                        logging.info(
+                            "autopkgtest has been killed intentionally - removing message %s from queue"
+                            % body
+                        )
+                        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 4673fd1..62181df 100644
--- a/docs/administration.rst
+++ b/docs/administration.rst
@@ -484,7 +484,7 @@ 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
-  kill -15 $pid
+  kill -9 $pid
 
 This will kill the autopkgtest process, and then the worker will `ack` the test request
 message, causing the test to not be re-queued, and then the worker will also ensure
-- 
Mailing list: https://launchpad.net/~canonical-ubuntu-qa
Post to     : canonical-ubuntu-qa@lists.launchpad.net
Unsubscribe : https://launchpad.net/~canonical-ubuntu-qa
More help   : https://help.launchpad.net/ListHelp

Reply via email to