Ensure that the millRun goroutine terminates when Close called.
This is an attempt to upstream and complete the patch that @howbazaar started a couple of years ago.
The motivation for this patch is to move back to tracking upstream rather than an independent fork.
The original description and PR https://github.com/natefinch/lumberjack/pull/100:
Currently the millRun goroutines leaks. This is very noticeable if a Logger is constructed periodically, used and then closed. This change ensures that the millCh channel is closed if it exists. Existing log rotation tests cover the duplicate Close calls.
This is a pretty important resource leak, @natefinch can you please take a look? I'm experiencing the same issue, no matter if I close the logger or not.
Also this is related https://github.com/natefinch/lumberjack/issues/205
Thanks
Also this https://github.com/natefinch/lumberjack/pull/57 this https://github.com/natefinch/lumberjack/pull/80 and this https://github.com/natefinch/lumberjack/pull/90 among others, this is getting worrisome, is this library maintained?
@natefinch This issue is mentioned by many users. Pls take a look.