Handle losing association endpoints
If the endpoint path of an association (not the path that has the
org.openbmc.Associations interface) goes off of D-Bus, then remove the 2
association objects and move this association to the list of pending
ones. That way if it ever comes back, the association objects will be
re-added.
This commit adds a moveAssociationToPending function in the code paths
where the mapper sees D-Bus paths going away. That function will find
all associations that involve that path, and then remove the actual
association paths and add them to the list of pending ones.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I14d5ddf8f65be866c2cedd5f467d65adf8e3af95
diff --git a/src/processing.cpp b/src/processing.cpp
index d3b7a76..6cc876d 100644
--- a/src/processing.cpp
+++ b/src/processing.cpp
@@ -70,6 +70,19 @@
{
removeAssociation(pathIt->first, wellKnown, server, assocMaps);
}
+
+ // Instead of checking if every single path is the endpoint of an
+ // association that needs to be moved to pending, only check when
+ // we own this path as well, which would be because of an
+ // association.
+ if ((pathIt->second.size() == 2) &&
+ (pathIt->second.find("xyz.openbmc_project.ObjectMapper") !=
+ pathIt->second.end()))
+ {
+ // Remove the 2 association D-Bus paths and move the
+ // association to pending.
+ moveAssociationToPending(pathIt->first, assocMaps, server);
+ }
}
pathIt->second.erase(wellKnown);
if (pathIt->second.empty())