diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-04-26 20:26:15 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-04-29 16:27:48 +0200 |
commit | 8b26cdbd2a949b02c0f4d94d0e157cdb9438d246 (patch) | |
tree | 48f3be87a92936994ff5f41f2005b89c1b9bffc3 /src/core/socket.h | |
parent | 3282493ad0038fc2051506dd0994638dd74458d1 (diff) |
core: introduce activation rate limiting for socket units
This adds two new settings TriggerLimitIntervalSec= and TriggerLimitBurst= that
define a rate limit for activation of socket units. When the limit is hit, the
socket is is put into a failure mode. This is an alternative fix for #2467,
since the original fix resulted in issue #2684.
In a later commit the StartLimitInterval=/StartLimitBurst= rate limiter will be
changed to be applied after any start conditions checks are made. This way,
there are two separate rate limiters enforced: one at triggering time, before
any jobs are queued with this patch, as well as the start limit that is moved
again to be run immediately before the unit is activated. Condition checks are
done in between the two, and thus no longer affect the start limit.
Diffstat (limited to 'src/core/socket.h')
-rw-r--r-- | src/core/socket.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/socket.h b/src/core/socket.h index b537b026a7..2a4b1bb674 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -52,6 +52,7 @@ typedef enum SocketResult { SOCKET_FAILURE_EXIT_CODE, SOCKET_FAILURE_SIGNAL, SOCKET_FAILURE_CORE_DUMP, + SOCKET_FAILURE_TRIGGER_LIMIT_HIT, SOCKET_FAILURE_SERVICE_START_LIMIT_HIT, _SOCKET_RESULT_MAX, _SOCKET_RESULT_INVALID = -1 @@ -156,6 +157,8 @@ struct Socket { bool reset_cpu_usage:1; char *fdname; + + RateLimit trigger_limit; }; /* Called from the service code when collecting fds */ |