mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-01 22:47:46 +00:00
fix(engine): sync outputs before printing stats at shutdown
Signed-off-by: Luca Guerra <luca@guerra.sh>
This commit is contained in:
parent
d3a67c10bd
commit
70c10ee7e0
@ -585,6 +585,12 @@ falco::app::run_result falco::app::actions::process_events(falco::app::state& s)
|
||||
}
|
||||
}
|
||||
|
||||
// By deleting s.outputs, we make sure that the engine will wait until
|
||||
// regular output has been completely sent before printing stats, avoiding
|
||||
// intermixed stats with output.
|
||||
// Note that this will only work if this is the last reference held by the
|
||||
// shared pointer.
|
||||
s.outputs.reset();
|
||||
s.engine->print_stats();
|
||||
|
||||
return res;
|
||||
|
Loading…
Reference in New Issue
Block a user