In case an exception in thrown, the channel would be left opened. If
this happens in a loop, that script can quickly have a big number of
dangling channels. I've observed more than 2k in a single night.
See https://www.rabbitmq.com/docs/channels
This documentation is well written, and even has a section about channel
leaks. Those two channels that are now being closed were opened for
every test processed, meaning the number of opened channels on RabbitMQ
kept growing: this was exactly a channel leak.
This is a first patch closing two very obvious leaks, but there might be
others. However, this has already helped stabilize RabbitMQ resource
consumption by a lot. Time will tell if we have other similar situation.
fix: web: ensure that autopkgtest.db.sha256 is symlinked
The functionality to symlink /home/ubuntu/public/autopkgtest.db to the
static directory which the flask web app serves files from was
duplicated for autopkgtest.db.sha256 - however a flag wasn't added for
this new statically served file, and the flag for the db being symlinked
was already set, meaning the `symlink_public_db` function wasn't
executed in production and thus autopkgtest.db.sha256 was never
symlinked or served via the web app.
Additionally to this, symlinking the sha256 file was in the same
try/except block as the db itself, where the exception was a
FileExistsError. The db symlink already existed, meaning the exception
was thrown, and thus the sha256 file wouldn't have been symlinked even
with a separate flag as described above.
This commit amends the issue by adding a second flag for the sha256
file, and symlinking the db and the sha256 file in a loop, separately.
The functionality beforehand in which the public directory is created,
was moved to it's own try/except block also.
fix: cloud: make create-nova-image-with-proposed-package up to date
This commit introduces a new mechanism of loading creds for the
aforementioned script, given that we now use a wider variety of
datacentres, and this script was last updated nearly 5 years ago.
This script also adds two new dependencies to the cloud-worker charm:
- qemu-user-static
- binfmt-support
These are required for the script to execute bash commands on vm's on a
different arch to the host VM - i.e. on arm64 from an amd64 host.
It also modifies the mechanism in which the desired package is installed
from proposed, and does away with the sed line that existed before.
create-nova-image-with-proposed is a script, which hasn't been used in
*quite* a while, which rebuilds one of our adt images, with a specified
package from proposed.
We had to use this recently when the version of base-files in the
release pocket was breaking our tests, but the version of base-files
in the proposed pocket would fix said issue.
fix: web: fix timer syntax in apache-request-monitoring.timer
This was missed in a previous MP, but the syntax in the timer file for
this unit was incorrect and thus was only triggering at 5 past midnight
rather than every 5 minutes.
This commit amends the issue by adding the proper syntax for running the
unit every 5 minutes.