Add Runner hooks for -k rotate event#2380
Conversation
rousskov
left a comment
There was a problem hiding this comment.
I think this PR moves Squid in the wrong direction. If it is not closed now, I plan to come back to it after the current backlog is dealt with.
|
|
||
| /// Called after rotating log files. | ||
| /// Meant for modules that need to (re-)attach to log files after rotation. | ||
| virtual void finishLogRotate() {} |
There was a problem hiding this comment.
I doubt it is a good idea to have "unattached" modules that are waiting for this event.
There was a problem hiding this comment.
I believe we already agreed there are better ways than Squid currently does. Unfortunately my attempts to form an architectural design that works in any way different have been constantly vetoed for more than a decade. So we are left with modules and helpers that log directly to the log files and detach/reattach on rotation.
This PR is a prerequisite to reducing circular dependencies in the Squid linker libraries within the constraints of that status quo.
|
|
||
| /// Called after receiving a log rotate request. | ||
| /// Meant for modules that manage log files to rename/rotate them. | ||
| virtual void rotateLogs() {} |
There was a problem hiding this comment.
We should fix (or at least agree on how to fix) SMP log rotation problems before introducing a new (and unused) log rotation API. Merging #1223 could be a step in that direction, but we know that more work is needed. My current preference would be for options B+D that do not match the API proposed in this PR.
There was a problem hiding this comment.
The SMP issues are not relevant to the issues being resolved by the refactor this PR is part of.
Right now we have a circular dependency where SignalEngine calls some components, which in turn rely on Comm, which relies on SignalEngine.
SignalEngine already uses RunnersRegistry for components to subscribe/register their signal handlers (ie. -k shutdown, -k reconfigure, -k check). This PR is just adding the missing hooks for the -k rotate signal handlers to self-register instead of hard-coding that circular dependency.
No description provided.