Comment 21 for bug 1485784

Revision history for this message
Cheryl Jennings (cherylj) wrote :

Review request: http://reviews.vapour.ws/r/2729/

The proposed code change retries the lxc-create (and also lxc-clone) call 3 times, with a 10 second delay between attempts. While this doesn't "fix" the issue where lxc-create fails during an apt-get upgrade, it will allow the deployment of the container to recover from this temporary error condition.

This can be treated as a temporary error since we know that subsequent calls to lxc-create after the apt-get upgrade completes will succeed. The error log for this bug shows that a subsequent attempt to create the template container succeeded (see comment #12).

In regards to preventing the error from happening in the first place, the basic message from the lxc team about this was "don't create containers while doing an upgrade". The way we can guarantee that upgrades don't happen while we're creating containers is to hold the apt-cache lock during the creation. We could end up holding this lock for an arbitrary amount of time during the container creation, so I'd rather not do that. This is why I opted for retrying the container creation instead.