]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: fix priority ordering in notify-handling 1707/head
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 28 Oct 2015 18:11:36 +0000 (19:11 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Wed, 28 Oct 2015 18:11:36 +0000 (19:11 +0100)
commitb215b0ede11c0dda90009c8412609d2416150075
tree43eb98447bc9cd3f0ff624b2b94f34a8d1806126
parentdf5b3e1840a373dca1e3da5b81540b7862994ab4
core: fix priority ordering in notify-handling

Currently, we dispatch NOTIFY messages in a tight loop. Regardless how
much data is incoming, we always dispatch everything that is queued.
This, however, completely breaks priority event-handling of sd-event.
When dispatching one NOTIFY event, another completely different event
might fire, or might be queued by the NOTIFY handling. However, this
event will not get dispatched until all other further NOTIFY messages are
handled. Those might even arrive _after_ the other event fired, and as
such completely break priority ordering of sd-event (which several code
paths rely on).

Break this by never dispatching multiple messages. Just return after each
message that was read and let sd-event handle everything else.

(The patch looks scarier that it is. It basically just drops the for(;;)
 loop and re-indents the loop-content.)
src/core/manager.c