[External] Re: Delayed match callback with sdbusplus asio APIs

Lei Yu yulei.sh at bytedance.com
Tue May 10 12:03:09 AEST 2022


On Tue, May 10, 2022 at 4:53 AM Ed Tanous <ed at tanous.net> wrote:
>
> On Thu, Mar 10, 2022 at 9:17 PM Lei Yu <yulei.sh at bytedance.com> wrote:
> >
> > This mail is to describe an issue that the match signal's callback is
> > delayed if it's using sdbusplus asio APIs.
> >
> > # TL;DR
> > If the app is using sync DBus calls and using asio to register a match
> > callback, the callback may be delayed if it occurs when the sync DBus
> > call is ongoing.
> > Note the issue does not occur if it's not using asio APIs.
>
> You're doing blocking calls in an async daemon.  That's why your code
> has a bug in it.
>
> One such example is on line 89:
> auto reply = bus.call(method);
>
> That will block the main event reactor until it returns.  Take a look
> at something like bmcweb for how to do async method calls without
> blocking the main reactor.

So does it mean we can NOT use blocking DBus calls at all with async daemon?

-- 
BRs,
Lei YU


More information about the openbmc mailing list