[systemd-devel] udevadm settle hangs due to veths in seperate network namespaces
Daniel P. Berrange
berrange at redhat.com
Fri Jul 12 07:14:28 PDT 2013
On Fri, Jul 12, 2013 at 04:10:35PM +0200, Kay Sievers wrote:
> On Fri, Jul 12, 2013 at 3:51 PM, Daniel P. Berrange <berrange at redhat.com> wrote:
> > We're hitting a problem in libvirt where 'udevadm settle' will get stuck
> > in a loop until it eventually times out. Eventually we realized this
> > happens when we have any LXC containers active with veth devices in a
> > separate network namespace.
> >
> > It is quite easy to reproduce the hang. In one terminal session start
> > a new network namespace:
> >
> > # unshare --net /bin/sh
> > sh-4.2# echo $$
> > 30718
> >
> > Now in another terminal create a veth pair, and move one of the pair
> > into the network namespace:
> >
> > # ip link add name FOO type veth peer name BAR
> > # ip link set FOO netns 30718
> >
> > Now udevadm will hang:
> >
> > # udevadm settle
> >
> > until it times out after 2 minutes.
> >
> > Looking at the udevadm code I discovered that
> >
> > udev_queue_get_queue_is_empty
> >
> > will never return true if there is any veth device that has been moved
> > into a separate network namespace.
> >
> > Adding some debugging I can see that the variable 'seqnum_udev' is
> > forever less than 'seqnum_kernel' in this scenario.
> >
> > Any ideas on how to solve this problem with udevadm settle ?
>
> Hmm, we just don't really support running udev inside of containers.
> Hotplug and full OS containers have did never get any real attention
> from udev running inside container setups.
This example is *not* running udev in the container. The 'udevadm settle'
command above is being run in the primary OS. IOW, the fact that the
container has a network namespace with a veth, is breaking udevadm in
the host.
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the systemd-devel
mailing list