Race condition between bridge-utils pre-up and udev scripts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bridge-utils (Ubuntu) |
Triaged
|
High
|
Unassigned |
Bug Description
I have the following in my /etc/network/
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.11.12.13
netmask 255.255.255.0
gateway 10.11.12.1
auto l2gre0
iface l2gre0 inet manual
pre-up ip link add name $IFACE type gretap local 10.11.12.13 remote 10.13.14.15
up ip link set dev $IFACE up
down ip link set dev $IFACE down
post-down ip link delete $IFACE
auto sw0
iface sw0 inet manual
pre-up ip link set dev eth1 promisc on
bridge_ports eth1 l2gre0
bridge_stp off
bridge_fd 0.1
bridge_maxwait 0
post-up sysctl -q net.ipv4.
I've found that on reboot, about 50% of the time the bridge comes up fine, and about 50% of the time the bridge comes up half-configured (it has l2gre0 attached but not eth1, and the stp and fd settings are not configured). When it fails, "device sw0 already exists; can't create bridge with the same name" shows up in the logs.
The problem seems to be a race condition between /lib/bridge-
udev event triggered for eth0
udev event triggered for eth1 (ignored by bridge-
udev event triggered for lo
ifup called for eth0
ifup called for lo
ifup called for l2gre0
Then, the following two operations happen in parallel:
udev event triggered for l2gre0
ifup called for sw0
If ifup happens to reach the 'brctl addbr' command in /lib/bridge-
This race condition appears to have been introduced by the fix for Bug #1003656 ... Before that fix, /lib/udev/
As for fixing this problem, I can't say that I'm aware of every possible use case here, but it seems to me that /lib/udev/
Changed in bridge-utils (Ubuntu): | |
importance: | Undecided → High |
Changed in bridge-utils (Ubuntu): | |
status: | New → Triaged |