~hloeung/ubuntu-repository-cache/dont-disable-unit-on-failover-or-pause

« back to all changes in this revision

Viewing changes to lib/ubuntu_repository_cache/util.py

  • Committer: mergebot at canonical
  • Author(s): "Haw Loeung"
  • Date: 2021-02-11 00:10:12 UTC
  • mfrom: (302.1.18 ubuntu-repository-cache-charm)
  • Revision ID: mergebot@juju-139df4-prod-is-toolbox-0.canonical.com-20210211001012-kqo689iwhp000de5
New health check endpoint for load balancers to use

Load balancers can either monitor metadata (e.g. ubuntu/dists/*) or
pool files, which are proxied to the real archive
servers. Unfortunately, most can only check one thing so if the other
is having issues, it is not taken offline and still being used.

The new health check endpoint checks a few things and reports back OK
if all are healthy and fine. This means load balancers can just hit
this one endpoint and will take it offline if any of the components
are experiencing issues.

Reviewed-on: https://code.launchpad.net/~hloeung/ubuntu-repository-cache/health-check-endpoint/+merge/397547
Reviewed-by: Barry Price <barry.price@canonical.com>
Reviewed-by: Benjamin Allot <benjamin.allot@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
SERVICE = 'ubuntu-repository-cache'
18
18
 
19
19
# Log file and directory for the repository sync cron job
20
 
REPO_SYNC_DIR = '/var/log/repository-sync'
 
20
REPO_SYNC_DIR = '/var/log/ubuntu-repository-cache'
21
21
REPO_SYNC_CRON_LOG = os.path.join(REPO_SYNC_DIR, 'repository-sync-cron.log')
22
22
 
23
23
# A file we'll touch when the metadata sync is running. Another run of the sync