Re: Fwd: sdbus-filedescriptor does reproducibly NOT get triggered in a specific situation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mi, 12.12.18 11:00, Jan Mueller (janmueller.email@xxxxxxxxxxxxxx) wrote:

> Dear systemd folks,
>
>
> I have the following issue:
>
> An application does not receive dbus signals on its dbus file descriptor
> *while waiting* for a
>
> dbus-method response. Considered time frame: between sending the
> method-call and receiving
>
> its response. After the response is being received, the (indefinitely)
> queued signal is not delivered
>
> until another signal / method call triggers the sdbus file descriptor
> (which is supervised by
>
> select()/epoll()).
>
> I committed a brief example with some more extensive explanation to:
>
> https://github.com/mue-jan/dbus-missing-signals-or-fd-issue

Don't use select() anymore. It's inefficient and can't handle fds >
1024. Use poll() or epoll(). (I'll prep a patch now that removes any
mention of select() from our man pages, as we shouldn't mislead users
to ever use it.)

Morever, when waiting on a bus object you need to use the fd returned
by sd_bus_get_fd() and wait for the events returned by
sd_bus_get_events() (which are POLLIN/POLLOUT/… events). Yes this
could benefit from documentation. The timeout passed to poll() should
be the one returned by sd_bus_get_timeout() or shorter.

Whenever poll() reports anything call sd_bus_process(), which will do
the work.

Lennart

--
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux