crowdsecurity / crowdsec

CrowdSec - the open-source and participative security solution offering crowdsourced protection against malicious IPs and access to the most advanced real-world CTI.
https://crowdsec.net
MIT License
8.79k stars 453 forks source link

Bug/ Go routine leak on reloading crowdsec #876

Open sbs2001 opened 3 years ago

sbs2001 commented 3 years ago

Describe the bug When crowdsec agent is reloaded, it leaks 1 go routine. This happens only when crowdsec is logging to a file. This leak is related to lumberjack at https://github.com/crowdsecurity/crowdsec/blob/4bb34d8e77ccd7191b8695ee4a3ebe03eae1c721/pkg/types/utils.go#L25 . The leaked go routine is tracked upstream at https://github.com/natefinch/lumberjack/issues/56

Note that doing LogOutput .Close() should stop the leaking go routine, but it doesn't. This is an issue with upstream.

To Reproduce Steps to reproduce the behavior: 1.Do sudo systemctl reload crowdsec

  1. Check number of go routines. They increase on each reload

Expected behavior Reload should not increase number of go routines

LaurenceJJones commented 1 year ago

@sbs2001 is this bug still relevant?

sbs2001 commented 1 year ago

Yes, it's still not fixed in upstream