Systemd/src
Lennart Poettering e0a085811d 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
2018-02-27 19:54:29 +01:00
..
ac-power
activate process-util: add another fork_safe() flag for enabling LOG_ERR/LOG_WARN logging 2018-01-04 13:27:26 +01:00
analyze analyze: fix typo in error message 2018-02-13 10:03:09 +01:00
ask-password
backlight
basic missing_syscall: add pkey_mprotect for ppc (#8292) 2018-02-27 13:33:00 +01:00
binfmt
boot Add missing double quote from log message (#8257) 2018-02-23 00:18:29 +01:00
busctl Comment the fact that some tools need to termintate their bus connect first 2018-01-12 16:20:36 +01:00
cgls tree-wide: port all code to use safe_getcwd() 2018-01-17 11:17:38 +01:00
cgroups-agent
cgtop tree-wide: use path_hash_ops instead of string_hash_ops whenever we key by a path 2018-02-12 11:07:55 +01:00
core core: don't process dbus unit and job queue when there are already too many messages pending 2018-02-27 19:54:29 +01:00
coredump tree-wide: reopen log when we need to log in FORK_CLOSE_ALL_FDS children 2018-02-22 00:35:00 +01:00
cryptsetup log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
debug-generator log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
delta tree-wide: reopen log when we need to log in FORK_CLOSE_ALL_FDS children 2018-02-22 00:35:00 +01:00
detect-virt
dissect
environment-d-generator
escape
firstboot tty-ask-password-agent: don't open terminal multiple times 2018-02-14 00:11:16 +01:00
fsck tree-wide: make use of wait_for_terminate_and_check() at various places 2018-01-04 13:27:27 +01:00
fstab-generator fstab-generator: downgrade message when we can't canonicalize fstab entries (#8281) 2018-02-27 07:58:19 +01:00
fuzz fuzz: cast to void when return value is ignored 2018-01-22 09:58:29 +09:00
getty-generator log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
gpt-auto-generator log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
hibernate-resume log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
hostname meson: drop unnecessary "transformation" of policy files 2018-02-16 13:01:12 +01:00
hwdb
import stat-util: unify code that checks whether something is a regular file 2018-02-20 15:39:31 +01:00
initctl log: minimize includes in log.h 2018-01-11 14:44:31 +01:00
journal journal: drop left-over header line 2018-02-23 00:13:52 +01:00
journal-remote journal-upload: make use of safe_close() where appropriate 2018-02-26 18:45:28 +01:00
kernel-install
libsystemd sd-bus: add APIs to query the current read and write queue size 2018-02-27 19:54:29 +01:00
libsystemd-network logind: fd 0 is a valid fd 2018-02-26 18:39:32 +01:00
libudev Merge pull request #8134 from keszybz/unit-load-paths 2018-02-09 17:08:23 +01:00
locale meson: drop unnecessary "transformation" of policy files 2018-02-16 13:01:12 +01:00
login logind: make sure we don't trip up on half-initialized session devices 2018-02-26 18:39:32 +01:00
machine Merge pull request #8202 from keszybz/avoid-msgmerge 2018-02-18 19:56:50 +01:00
machine-id-setup
modules-load
mount Comment the fact that some tools need to termintate their bus connect first 2018-01-12 16:20:36 +01:00
network tree-wide: use "cannot" instead of "can not" 2018-02-08 10:34:52 +01:00
notify notify: add new --uid= command 2018-01-11 15:12:16 +01:00
nspawn tree-wide: use reallocarray instead of our home-grown realloc_multiply (#8279) 2018-02-26 21:20:00 +01:00
nss-myhostname
nss-mymachines nss-mymachines: add work-around to silence gcc warning 2018-02-06 17:08:42 +09:00
nss-resolve resolve: Adjust and unify D-Bus call timeout (#7847) 2018-01-23 09:53:31 +09:00
nss-systemd nss-systemd: add work-around to silence gcc warning 2018-02-05 15:21:07 +01:00
partition log: minimize includes in log.h 2018-01-11 14:44:31 +01:00
path
quotacheck process-spec: add another flag FORK_WAIT to safe_fork() 2018-01-04 13:27:27 +01:00
random-seed
rc-local-generator log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
remount-fs process-util: add another fork_safe() flag for enabling LOG_ERR/LOG_WARN logging 2018-01-04 13:27:26 +01:00
reply-password
resolve meson: drop unnecessary "transformation" of policy files 2018-02-16 13:01:12 +01:00
rfkill
run tree-wide: install matches asynchronously 2018-01-05 13:58:32 +01:00
shared tree-wide: use reallocarray instead of our home-grown realloc_multiply (#8279) 2018-02-26 21:20:00 +01:00
sleep
socket-proxy
stdio-bridge
sulogin-shell process-util: rework wait_for_terminate_and_warn() to take a flags parameter 2018-01-04 13:27:27 +01:00
sysctl tree-wide: use path_hash_ops instead of string_hash_ops whenever we key by a path 2018-02-12 11:07:55 +01:00
system-update-generator log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
systemctl systemd-sysv-install: avoid using ROOT variable from the environment 2018-02-23 20:05:35 +01:00
systemd core: don't process dbus unit and job queue when there are already too many messages pending 2018-02-27 19:54:29 +01:00
sysusers tmpfiles: allow admin/runtime overrides to runtime config 2018-02-05 15:04:52 +01:00
sysv-generator log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
test Merge pull request #8282 from poettering/khash-enokey 2018-02-27 12:34:41 +03:00
timedate meson: drop unnecessary "transformation" of policy files 2018-02-16 13:01:12 +01:00
timesync tree-wide: use "cannot" instead of "can not" 2018-02-08 10:34:52 +01:00
tmpfiles Merge pull request #8144 from poettering/journal-inotify-fixes 2018-02-14 13:52:17 +01:00
tty-ask-password-agent tty-ask-password-agent: reenable color for boot-time password prompt 2018-02-14 14:30:30 +01:00
udev Merge pull request #8258 from keszybz/log-issues 2018-02-23 19:54:32 +01:00
update-done
update-utmp
user-sessions nologin: extend the /run/nologin descriptions a bit (#8244) 2018-02-22 14:21:30 +01:00
vconsole process-util: rework wait_for_terminate_and_warn() to take a flags parameter 2018-01-04 13:27:27 +01:00
veritysetup log: remove LOG_TARGET_SAFE pseudo log target 2018-01-24 18:22:56 +01:00
volatile-root