Merge lp://qastaging/~stub/charm-helpers/bug-1705337-lower-apt-retries into lp://qastaging/charm-helpers

Proposed by Stuart Bishop
Status: Merged
Approved by: Alex Kavanagh
Approved revision: 764
Merged at revision: 768
Proposed branch: lp://qastaging/~stub/charm-helpers/bug-1705337-lower-apt-retries
Merge into: lp://qastaging/charm-helpers
Diff against target: 12 lines (+1/-1)
1 file modified
charmhelpers/fetch/ubuntu.py (+1/-1)
To merge this branch: bzr merge lp://qastaging/~stub/charm-helpers/bug-1705337-lower-apt-retries
Reviewer Review Type Date Requested Status
Alex Kavanagh Approve
Review via email: mp+327776@code.qastaging.launchpad.net

Description of the change

apt currently retries failures up to 30 times, with a 10 second delay between calls. Plus its own internal retries. So an apt command failing due to, say, no package existing in the archive for the correct architecture will lock up apt and the hooks for 5-30 minutes. This is primarily to work around the common 'dpkg lock' bug, where it is impossible to reliably run apt commands under due to the global lock implementation.

This retry behaviour is completely incompatible with modern juju, which runs an update-status hook every 5 minutes and retries failed hooks. With the apt retries, and charm helper retries, and juju retries, and a backlog of update-status hooks, the apt lock gets held open indefinitely making it a) difficult to fix the problem and b) blocks important things like security updates or other hooks needing to run on the machine (subordinates, primary, actions etc.)

This branch lowers the retry count to something slightly saner, so an apt fail should complete in under 5 minutes allowing other processes to get a look in. It does not fix the underlying problem.

See https://bugs.launchpad.net/charm-helpers/+bug/1705337 for original bug report

To post a comment you must log in.
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

This seems to make perfect sense to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches