[Bug 1825194] Re: resolvconf is racy, which leads to broken resolv.conf in parallel calls
@vorlon, @tsimonq2, patch for xenial attached, and description changed for SRU. Sponsors teamm re-subscribed. ** Summary changed: - resolvconf is racy, which leads to broken resolv.conf in parallel calls + [SRU] resolvconf is racy, which leads to broken resolv.conf in parallel calls -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1825194 Title: [SRU] resolvconf is racy, which leads to broken resolv.conf in parallel calls To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1825194/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1825194] Re: resolvconf is racy, which leads to broken resolv.conf in parallel calls
Patch for xenial. ** Description changed: + [Impact] + + The bug can lead to non-working DNS. This is a critical bug that needs + to be fixed in the stable release. + + The patch fixes the bug by using a file lock via the flock command. + + [Test case] + + This script should eventually stop with the current version, thing that + should not happen after applying the patch: + + while true; do + printf "\n" | sudo resolvconf -a NetworkManager + printf "nameserver 8.8.8.8\n" | sudo resolvconf -a networkd + wait + printf "nameserver 8.8.8.8\n" | + sudo resolvconf -a NetworkManager & + printf "\n" | sudo resolvconf -a networkd + wait + ping -c 1 www.google.com || break + done + + [Regression Potential] + + The patch is small and what it does is straightforward. It has also been + thoroughly tested. However, the effect if something is wrong would be + not being able to resolve DNS names, which is disastrous, so it needs to + be very well tested for the SRU. + + [Other Info] + It has been found that simultaneous calls to resolvconf can lead to inconsistent content in resolv.conf. For instance, no nameservers while NetworkManager has one in its record (see LP: #1824395): $ cat /run/resolvconf/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN $ cat /run/resolvconf/interface/NetworkManager nameserver 192.168.1.6 nameserver 192.168.1.2 This can happen easily when calling "netplan apply", which can re-start both networkd and NM. resolvconf is called at that point by the "systemd-networkd-resolvconf-update.service" service, and also directly by NetworkManager, which leads to the situation described above. This is not surprising as there is nothing preventing different instances of resolvconf to access the same files. This sort of situation can be reproduced by running in a loop commands like: $ printf "\n" | sudo resolvconf -a NetworkManager & printf "\n" | sudo resolvconf -a networkd $ printf "nameserver 80.58.61.250\n" | sudo resolvconf -a NetworkManager & printf "\n" | sudo resolvconf -a networkd Eventually, this leads to a resolv.conf that is not consistent with the last run command. ** Patch added: "xenial-debdiff.patch" https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1825194/+attachment/5257832/+files/xenial-debdiff.patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1825194 Title: [SRU] resolvconf is racy, which leads to broken resolv.conf in parallel calls To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1825194/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1825194] Re: resolvconf is racy, which leads to broken resolv.conf in parallel calls
Unsubscribing the Sponsors Team because there is no SRU bug template yet. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1825194 Title: resolvconf is racy, which leads to broken resolv.conf in parallel calls To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1825194/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1825194] Re: resolvconf is racy, which leads to broken resolv.conf in parallel calls
This bug was fixed in the package resolvconf - 1.79ubuntu13 --- resolvconf (1.79ubuntu13) disco; urgency=medium * bin/resolvconf: use flock so resolvconf can be called in parallel safely (LP: #1825194). -- Alfonso Sanchez-Beato (email Canonical) Wed, 17 Apr 2019 16:53:53 +0200 ** Changed in: resolvconf (Ubuntu) Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1825194 Title: resolvconf is racy, which leads to broken resolv.conf in parallel calls To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1825194/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1825194] Re: resolvconf is racy, which leads to broken resolv.conf in parallel calls
I assume this is primarily an issue for UC16, since in UC18 we no longer use resolvconf at all, and have targeted the bug accordingly. Do you want to prepare a corresponding debdiff for xenial, and adjust the bug description to include a complete SRU template per https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template ? ** Also affects: resolvconf (Ubuntu Xenial) Importance: Undecided Status: New ** Changed in: resolvconf (Ubuntu) Status: New => Fix Committed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1825194 Title: resolvconf is racy, which leads to broken resolv.conf in parallel calls To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1825194/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1825194] Re: resolvconf is racy, which leads to broken resolv.conf in parallel calls
** Tags added: disco ** Tags added: rls-ee-incoming -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1825194 Title: resolvconf is racy, which leads to broken resolv.conf in parallel calls To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1825194/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1825194] Re: resolvconf is racy, which leads to broken resolv.conf in parallel calls
@Alfonso What's the use case for calling 'netplan apply' in this scenario? Is NM the configured as the netplan renderer? Is there ever a case where "systemd-networkd-resolvconf-update.service" can call resolvconf even though NM is the renderer from the start (i.e. there's no transition from networkd to NM)? I've always contended that mixing two network management services on the same device was asking for trouble... -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1825194 Title: resolvconf is racy, which leads to broken resolv.conf in parallel calls To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1825194/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1825194] Re: resolvconf is racy, which leads to broken resolv.conf in parallel calls
The attachment "debdiff.patch" seems to be a debdiff. The ubuntu- sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team. [This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.] ** Tags added: patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1825194 Title: resolvconf is racy, which leads to broken resolv.conf in parallel calls To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1825194/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1825194] Re: resolvconf is racy, which leads to broken resolv.conf in parallel calls
** Patch added: "debdiff.patch" https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1825194/+attachment/5256569/+files/debdiff.patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1825194 Title: resolvconf is racy, which leads to broken resolv.conf in parallel calls To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1825194/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs