ironsmile / nedomi

Highly performant HTTP reverse proxy with efficient caching of big files
GNU General Public License v3.0
81 stars 9 forks source link

storage.scheduler: get a reloadable logger - fixes leaking loggers #214

Closed mstoykov closed 8 years ago

mstoykov commented 8 years ago

previously the scheduler did not have a logger and scheduled functions that wanted to log something (storage.GetExpirationHandler) had to bring one with them.

This has unfortunate side effect that while the function is scheduled the logger can't be freed.

But when reloading the loggers are closed and than reopened. This is done so that the files can be logrotated/changed.

If a file is scheduled to be deleted in a week, the logger will not be GCed, for a week, and as such the fd to the log file will not be closed.