mirror of
https://github.com/falcosecurity/falco.git
synced 2026-03-18 18:58:41 +00:00
This fixes a segmentation fault that occurs when /metrics endpoint is accessed during Falco shutdown. The crash happens as the webserver continues serving /metrics requests after outputs and inspectors have been destroyed. Changes: - Create cleanup_outputs action to handle outputs destruction - Create print_stats action for stats printing - Reorder teardown steps to stop webserver before destorying outputs - Move outputs.reset() from process_events to cleanup_outputs() This eliminates the race condition by ensuring the webserver stops accepting requests before any subsystems are destroyed. The synchronisation behaviour of output.reset() block till queue flushed is preserved. Signed-off-by: Adnan Ali <adduali1310@hotmail.com>