This is an automated email from the ASF dual-hosted git repository.
bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/master by this push:
new d0db66540 [veth] Add todo to set mac address on create for peer link.
d0db66540 is described below
commit d0db6654094821cfb7520720041b30abef974d5b
Author: Jason Zhou <[email protected]>
AuthorDate: Mon Jul 15 13:02:55 2024 -0400
[veth] Add todo to set mac address on create for peer link.
Due to a systemd-induced race-condition related to the MacAddressPolicy
being set to 'persistent' on versions >= 242, we will have to set the
peer link MAC address of the peer link (eth0) when we create the eth0
peer link so that the udev will not try to overwrite it when it is
notified that this device was created, which would lead to a race
condition here where us and udev are racing to see who is the last one
to write our MAC address to eth0.
see: https://issues.apache.org/jira/browse/MESOS-10243
Review: https://reviews.apache.org/r/75087/
---
.../containerizer/mesos/isolators/network/port_mapping.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp
b/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp
index 3b3b899fb..52b63f524 100644
--- a/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp
+++ b/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp
@@ -5181,6 +5181,18 @@ string PortMappingIsolatorProcess::scripts(Info* info)
// checksum offloading ensures the TCP layer will checksum and drop
// it.
script << "ethtool -K " << eth0 << " rx off\n";
+ // TODO(jasonzhou): Set the link for the container eth0 in veth::create on
+ // creation to prevent race condition against udev
+ //
+ // Due to a systemd-induced race-condition related to the
+ // MacAddressPolicy being set to 'persistent' on versions >= 242,
+ // we will have to set the peer link MAC address of the peer link (eth0)
+ // when we create the eth0 peer link so that the udev will not try to
+ // overwrite it when it is notified that this device was created, which
+ // would lead to a race condition here where us and udev are racing to see
+ // who is the last one to write our MAC address to eth0.
+ //
+ // see: https://issues.apache.org/jira/browse/MESOS-10243
script << "ip link set " << eth0 << " address " << hostMAC
<< " mtu " << hostEth0MTU << " up\n";
script << "ip addr add " << hostIPNetwork << " dev " << eth0 << "\n";