Merge ~sergiodj/ubuntu/+source/squid3:squid-bug1761096-dnsmasq-hangs-restart into ubuntu/+source/squid3:ubuntu/xenial-devel
Status: | Merged |
---|---|
Approved by: | Christian Ehrhardt |
Approved revision: | 315e7dee173f16c6fb19a69ab26de3954ae32ae2 |
Merged at revision: | 315e7dee173f16c6fb19a69ab26de3954ae32ae2 |
Proposed branch: | ~sergiodj/ubuntu/+source/squid3:squid-bug1761096-dnsmasq-hangs-restart |
Merge into: | ubuntu/+source/squid3:ubuntu/xenial-devel |
Diff against target: |
35 lines (+17/-1) 2 files modified
debian/changelog (+11/-0) debian/squid.resolvconf (+6/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Christian Ehrhardt (community) | Approve | ||
Canonical Server Core Reviewers | Pending | ||
Canonical Server | Pending | ||
Review via email: mp+390333@code.launchpad.net |
Description of the change
This is a fix (more like a workaround) for bug #1761096.
This bug required a decent amount of investigative effort from both Christian and I, and even though we were unable to find the exact root cause for it, I'm pretty confident that the right way to go is to incorporate this proposed workaround in order to mitigate the issue.
When using dnsmasq along with squid on Ubuntu Xenial, the user will experience a deadlock while performing on every second execution of the "systemctl start dnsmasq.service" command. The deadlock will be caused by an attempt to invoke, by nss-lookup.target, a "systemctl reload squid.service", which will itself try to start the nss-lookup.target, which will be waiting on squid, therefore eventually leading to a timeout.
The underlying cause of this deadlock is related to how systemd used to handle dependencies between multiple jobs being started in the same transaction.
One can reproduce the issue on a Xenial container:
$ lxc launch ubuntu-daily:xenial squid-bug1761096
$ lxc shell squid-bug1761096
# apt update
# apt install squid dnsmasq -y
It is quite possible that during "apt install" the bug will manifest, and dnsmasq will fail to start due to a timeout. The user might see a message like:
Job for dnsmasq.service failed because a timeout was exceeded. See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
If the bug doesn't manifest itself during installation, the following commands in sequence should trigger it:
# systemctl restart dnsmasq.service
# systemctl restart dnsmasq.service
There is a PPA with the proposed change here:
https:/
autopkgtest is still happy:
autopkgtest [09:43:08]: @@@@@@@
squid PASS
I'm adding Christian to the list of reviewers because he helped with the investigation.