mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 07:07:04 +02:00
MINOR: log/sink: detect when log maxlen exceeds sink size
To prevent logs from being silently (and unexpectly droppped) at runtime, we check that the maxlen parameter from the log directives are strictly inferior to the targeted ring size. |global | tune.bufsize 16384 | log tcp@127.0.0.1:514 len 32768 | log myring@127.0.0.1:514 len 32768 |ring myring | # no explicit size On such configs, a diag warning will be reported. This commit depends on: - "MINOR: sink: simplify post_sink_resolve function" - "MINOR: ring: add a function to compute max ring payload"
This commit is contained in:
parent
d499485aa9
commit
ceaa1ddb06
@ -1299,6 +1299,12 @@ int sink_postresolve_logsrvs(struct list *logsrvs, const char *section, const ch
|
||||
logsrv->conf.file, logsrv->conf.line, logsrv->ring_name);
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
}
|
||||
if (sink && logsrv->maxlen > ring_max_payload(sink->ctx.ring)) {
|
||||
_e_sink_postresolve_logsrvs(ha_diag_warning, "log server", "uses a max length which exceeds ring capacity ('%s' supports %lu bytes at most).",
|
||||
section, section_name,
|
||||
logsrv->conf.file, logsrv->conf.line,
|
||||
logsrv->ring_name, (unsigned long)ring_max_payload(sink->ctx.ring));
|
||||
}
|
||||
logsrv->sink = sink;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user