mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
GH-780: Prevent log batches from indefinite buffering
Logs that got sent sparsely or burstily would get buffered for long periods of time since the logic to flush them only does so on the next log write. In the worst case, a subsequent log write could never happen and cause a log entry to be indefinitely buffered. This fix introduces a recurring event/timer to simply flush all pending logs at frequency of Broker::log_batch_interval.
This commit is contained in:
parent
0de6bba95e
commit
43e54c7930
17 changed files with 224 additions and 22 deletions
|
@ -379,6 +379,17 @@ export {
|
|||
|
||||
module Broker;
|
||||
|
||||
event Broker::log_flush() &priority=10
|
||||
{
|
||||
Broker::flush_logs();
|
||||
schedule Broker::log_batch_interval { Broker::log_flush() };
|
||||
}
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
schedule Broker::log_batch_interval { Broker::log_flush() };
|
||||
}
|
||||
|
||||
event retry_listen(a: string, p: port, retry: interval)
|
||||
{
|
||||
listen(a, p, retry);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue