Hi On Mon, Apr 13, 2015 at 4:49 PM, Daniel Drake <[email protected]> wrote: > On Sat, Apr 11, 2015 at 5:13 AM, David Herrmann <[email protected]> wrote: >> Nice catch! >> >> There's indeed a small race between handling inotify and queuing up >> the change-event. We need to re-loop there. One day we should switch >> to sd-event to avoid such bugs... I mean the symptom is inherent to >> queuing up events while handling them. Meh! > > Thanks for reviewing this. Reading your comment, I wonder if there is > a small bug in the solution here. > > Sometimes we may handle inotify events, but without generating change > events. After my change, we will loop again, but there may be no > events pending, in which case we will block on the 3 second timeout > before completing the next loop iteration and replying to settle's > ping message.
Not really. If a ctrl-message is pending, it will still be pending on the next iteration, and thus immediately wake up the epoll_wait(). We're level-triggered here, not edge triggered! Hence, as long as we didn't dispatch the ctrl-message, it's still pending and keep us awake. Thanks David _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
