]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/libsystemd/sd-event/sd-event.c
sd-event: add ability to ratelimit event sources
authorLennart Poettering <lennart@poettering.net>
Mon, 23 Nov 2020 17:02:40 +0000 (18:02 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Dec 2020 14:11:24 +0000 (15:11 +0100)
commitb6d5481b3d9f7c9b1198ab54b54326ec73e855bf
tree2a2f4b4416272b96e0e86ccb1ec9ad63ac5d47c2
parentf41315fceb5208c496145cda2d6c865a5458ce44
sd-event: add ability to ratelimit event sources

Let's a concept of "rate limiting" to event sources: if specific event
sources fire too often in some time interval temporarily take them
offline, and take them back online once the interval passed.

This is a simple scheme of avoiding starvation of event sources if some
event source fires too often.

This introduces the new conceptual states of "offline" and "online" for
event sources: an event source is "online" only when enabled *and* not
ratelimited, and offline in all other cases. An event source that is
online hence has its fds registered in the epoll, its signals in the
signalfd and so on.
src/libsystemd/libsystemd.sym
src/libsystemd/sd-event/event-source.h
src/libsystemd/sd-event/sd-event.c
src/systemd/sd-event.h