summaryrefslogtreecommitdiff
path: root/src/test/test-procfs-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-02-13 18:30:34 +0100
committerSven Eden <yamakuzure@gmx.net>2018-05-30 07:59:08 +0200
commit459590e77817fd0b3d14168642b96b65a4f829e7 (patch)
tree317e645e1a34995d9fc854349bbab16a06277a45 /src/test/test-procfs-util.c
parent1a07732212ebf11d6f517efb3721dfc00aef6fe0 (diff)
core: don't process dbus unit and job queue when there are already too many messages pending
We maintain a queue of units and jobs that we are supposed to generate change/new notifications for because they were either just created or some of their property has changed. Let's throttle processing of this queue a bit: as soon as > 1K of bus messages are queued for writing let's skip processing the queue, and then recheck on the next iteration again. Moreover, never process more than 100 units in one go, return to the event loop after that. Both limits together should put effective limits on both space and time usage of the function, delaying further operations until a later moment, when the queue is empty or the the event loop is sufficiently idle again. This should keep the number of generated messages much lower than before on busy systems or where some client is hanging. Note that this also means a bad client can slow down message dispatching substantially for up to 90s if it likes to, for all clients. But that should be acceptable as we only allow trusted bus clients, anyway. Fixes: #8166
Diffstat (limited to 'src/test/test-procfs-util.c')
0 files changed, 0 insertions, 0 deletions