openbmc / phosphor-virtual-sensor

Other
3 stars 5 forks source link

Fix race condition #3

Open RashmicaG opened 2 years ago

RashmicaG commented 2 years ago

As Patrick pointed out, in createVirtualSensorsFromDbus we have a race condition where the interface could be removed before we have added the callback for InterfacesRemoved:

There is a slight race condition here I think we need to deal with. We got a signal for InterfacesAdded and then we spent time processing it and then added a watch for InterfacesRemoved. It is possible that the interface has already been removed. Ideally we'd do a dbus query here to confirm the underlying config still exists, right?