tracee
tracee copied to clipboard
Bug: Sync issues between Tracee.Run() return and its goroutines finish
Currently, when tracee-ebpf receive the exit signal it finishes the Tracee.Run() function and return to main.
In main, the printer.Close() method is called which disable future writing to the printer.
However, the events pipeline isn't necessary closed when the printer is closed. This might lead to events loss from the output, and sync problem between the printer stats and the actual printed values.
Other similar issues might happen with other goroutines of the function.
Probably the solution to this issue will be to wait for all goroutines of Tracee.Run() to finish before exiting.
We did something similar in #874.
I am not sure if I have the time to take this in. If someone else think he can do it he can assign himself.
is this relevant?
@NDStrahilevitz feel free to close this if you think there is nothing to be done.
@NDStrahilevitz I ping you on it again
Isn't this a duplicate of https://github.com/aquasecurity/tracee/issues/2171 ?
Not quite but it makes sense to solve those two together
I'm tackling https://github.com/aquasecurity/tracee/pull/2688 and facing race issues, one solution is being to change Tracee.running bool flag to atomic.Bool.