Merge ~andersson123/autopkgtest-cloud:delete_old_github_requests into autopkgtest-cloud:master

Proposed by Tim Andersson
Status: Merged
Merged at revision: 4dff4d746464e88e744e5626d37074028758c66b
Proposed branch: ~andersson123/autopkgtest-cloud:delete_old_github_requests
Merge into: autopkgtest-cloud:master
Diff against target: 35 lines (+17/-0)
3 files modified
charms/focal/autopkgtest-web/units/delete-old-github-requests.service (+7/-0)
charms/focal/autopkgtest-web/units/delete-old-github-requests.timer (+8/-0)
charms/focal/autopkgtest-web/webcontrol/delete-old-github-requests (+2/-0)
Reviewer Review Type Date Requested Status
Paride Legovini Approve
Brian Murray Pending
Review via email: mp+451645@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paride Legovini (paride) wrote :

One inline comment (Needs fixing) on the implemention.

In general I'm not a fan of this kind of "hiding leaks by periodic cleanup" approach, unless the problem is fairly well understood. Do we have an idea of why github jobs "get lost" and then "forgotten about"? What does it mean that they "get lost"? If they're in queue, why aren't them processed at some point? What do you mean by "forgotten about"?

review: Needs Information
Revision history for this message
Tim Andersson (andersson123) wrote :

I don't have a good understanding of what happens. We have a ticket from a long time ago without much information to go off of.

Revision history for this message
Tim Andersson (andersson123) wrote :

I agree it's not a great approach, but I'm not personally sure investigating deep into why this happens is a particularly efficient use of time, especially at the moment, but I'm open to doing so if others disagree with me.

Revision history for this message
Tim Andersson (andersson123) wrote :

I've amended, please re-review

Revision history for this message
Paride Legovini (paride) wrote :

Technically LGTM, but I'm still uncomfortable with the vagueness of the issue. The commit message says

  github jobs sometimes get lost in the queue

what does it mean that they "get lost"? Are them in the queue or not? Where or how does these stale jobs show up?

Revision history for this message
Tim Andersson (andersson123) wrote :

I don't know. We don't have much information on the issue. The old card I picked up simply stated something similar to the commit message (ADT-64)

Revision history for this message
Paride Legovini (paride) wrote :

@Brian do you happen to know/remember more?

I am fine with merging this, but if we are able to explain the problem better in the commit message, we should.

review: Needs Information
Revision history for this message
Tim Andersson (andersson123) wrote :

I agree. I will contact Julian regarding this since he reported the card

Revision history for this message
Tim Andersson (andersson123) wrote :

as per juliank:

I think it's that the rabbitmq is not fully reliably persistent
But we add those files to the directory
So when rabbitmq needs to be restarted because it fails you end up with files you no longer have items queued for
Oh yeah and then I added the 24h TTL to the upstream queue

From 2022:
In light of the systemd upstream tests hanging and not leaving the queues on arm64, I have also applied a 24 hour message TTL on the upstream testing queues.

Hope that gives some context, I'll amend the commit message

Revision history for this message
Tim Andersson (andersson123) wrote :

I've amended the commit message, let me know what you think

Revision history for this message
Paride Legovini (paride) wrote :

This is much better, thanks for investigating!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charms/focal/autopkgtest-web/units/delete-old-github-requests.service b/charms/focal/autopkgtest-web/units/delete-old-github-requests.service
2new file mode 100644
3index 0000000..e4bec05
4--- /dev/null
5+++ b/charms/focal/autopkgtest-web/units/delete-old-github-requests.service
6@@ -0,0 +1,7 @@
7+[Unit]
8+Description=Delete github requests older than 1 day
9+
10+[Service]
11+Type=oneshot
12+User=ubuntu
13+ExecStart=/home/ubuntu/webcontrol/delete-old-github-requests
14diff --git a/charms/focal/autopkgtest-web/units/delete-old-github-requests.timer b/charms/focal/autopkgtest-web/units/delete-old-github-requests.timer
15new file mode 100644
16index 0000000..993c77f
17--- /dev/null
18+++ b/charms/focal/autopkgtest-web/units/delete-old-github-requests.timer
19@@ -0,0 +1,8 @@
20+[Unit]
21+Description=Delete github requests older than 1 day (timer)
22+
23+[Timer]
24+OnCalendar=hourly
25+
26+[Install]
27+WantedBy=autopkgtest-web.target
28diff --git a/charms/focal/autopkgtest-web/webcontrol/delete-old-github-requests b/charms/focal/autopkgtest-web/webcontrol/delete-old-github-requests
29new file mode 100755
30index 0000000..adf87f3
31--- /dev/null
32+++ b/charms/focal/autopkgtest-web/webcontrol/delete-old-github-requests
33@@ -0,0 +1,2 @@
34+#!/bin/sh
35+find /run/autopkgtest_webcontrol/github-pending/ -mtime +0 -exec echo "Deleting stale Github job: {}" \; -delete

Subscribers

People subscribed via source and target branches