Skip to content

Add Runner hooks for -k rotate event#2380

Open
yadij wants to merge 1 commit intosquid-cache:masterfrom
yadij:arc-runner-7
Open

Add Runner hooks for -k rotate event#2380
yadij wants to merge 1 commit intosquid-cache:masterfrom
yadij:arc-runner-7

Conversation

@yadij
Copy link
Contributor

@yadij yadij commented Feb 20, 2026

No description provided.

Copy link
Contributor

@rousskov rousskov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt it is a good idea to have "unattached" modules that are waiting for this event.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@yadij yadij added the S-waiting-for-reviewer ready for review: Set this when requesting a (re)review using GitHub PR Reviewers box label Feb 21, 2026
@yadij yadij requested a review from rousskov February 21, 2026 07:51
@yadij yadij mentioned this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-for-reviewer ready for review: Set this when requesting a (re)review using GitHub PR Reviewers box

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants