From 77635adb50d952f3a8d0cdfd0964e68d208e5960 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 7 Feb 2020 21:35:44 +0100 Subject: [PATCH 1/2] team: ignore bus name appearance if we can't determine process id If the GetConnectionUnixProcessID() call fails, the process that registered on the bus has died and we should ignore the name appearance event. (cherry picked from commit e94d76382c1fef2b4c1e012fdf9f5c55de5f0e91) --- src/devices/team/nm-device-team.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c index fb9c9c6963..a76a877589 100644 --- a/src/devices/team/nm-device-team.c +++ b/src/devices/team/nm-device-team.c @@ -380,11 +380,14 @@ teamd_dbus_appeared (GDBusConnection *connection, if (pid != priv->teamd_pid) teamd_cleanup (self, FALSE); } else { - _LOGW (LOGD_TEAM, "failed to determine D-Bus name owner"); - /* If we can't determine the bus name owner, don't kill our - * teamd instance. Hopefully another existing teamd just died and - * our instance will be able to grab the bus name. - */ + /* The process that registered on the bus died. If it's + * the teamd instance we just started, ignore the event + * as we already detect the failure through the process + * watch. If it's a previous instance that got killed, + * also ignore that as our new instance will register + * again. */ + _LOGD (LOGD_TEAM, "failed to determine D-Bus name owner, ignoring"); + return; } } From a0c209b653a7f6e9261dbd94d631af9fccd05466 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 7 Feb 2020 21:55:32 +0100 Subject: [PATCH 2/2] team: ignore bus name appearance when killing teamd If we are currently killing teamd, we are not interested in knowing when it becomes ready. (cherry picked from commit 554e9be5b04c4d590a8c210f6e75db931c893f7b) --- src/devices/team/nm-device-team.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c index a76a877589..a0749c21f6 100644 --- a/src/devices/team/nm-device-team.c +++ b/src/devices/team/nm-device-team.c @@ -356,6 +356,12 @@ teamd_dbus_appeared (GDBusConnection *connection, _LOGI (LOGD_TEAM, "teamd appeared on D-Bus"); nm_device_queue_recheck_assume (device); + if (priv->kill_in_progress) { + /* If we are currently killing teamd, we are not + * interested in knowing when it becomes ready. */ + return; + } + /* If another teamd grabbed the bus name while our teamd was starting, * just ignore the death of our teamd and run with the existing one. */