<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 20, 2022 at 2:13 PM Patrick Williams <<a href="mailto:patrick@stwcx.xyz">patrick@stwcx.xyz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, May 20, 2022 at 11:14:15AM +0800, Lei Yu wrote:<br>
<br>
> If mapper could not guarantee the stable result, the service calling<br>
> mapper will have to add more complex logic to make sure it gets the<br>
> "full and correct" result.<br>
<br>
The issue here is around causality.  There really isn't any way to<br>
correctly kick this logic out to applications no matter how complex you<br>
make the implementation.<br>
<br>
The original mapper implementation was causally ordered but this was<br>
lost in the conversion to C/C++.  We should look at getting back to<br>
having mapper give causal order guarantees.<br></blockquote><div><br></div><div>I'm not really following what causality has to do with it in Leis case.  From my read, it looks like this is a case of "introspect takes some time to complete, and the results for one daemon aren't expected to be added atomically".  This exact same race is present any time an object is added or removed from dbus, so you're right, there isn't really a way to avoid it, aside from writing implementations that don't fail if the object count on a connection doesn't match what the mapper gave you, which is something we "learned" in bmcweb a long time ago.</div><div><br></div><div>One workaround here to cover the startup case would be to simply batch together all objects for a given daemon in the InProgressIntrospect object such that all of a daemons dbus paths are added to the global object atomically, so we'd avoid the race in the startup case, but it would still exist when new objects are created, so it doesn't completely solve the problem, just solves it for the case above.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
-- <br>
Patrick Williams<br>
</blockquote></div></div>