Skip to content

Update Runner managing DNS components#2378

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

Update Runner managing DNS components#2378
yadij wants to merge 1 commit intosquid-cache:masterfrom
yadij:arc-runner-5

Conversation

@yadij
Copy link
Contributor

@yadij yadij commented Feb 19, 2026

Dns::ConfigRr was already managing part of the DNS
internal component activity. Update it to fully control
the startup/reconfigure/shutdown actions.

This fixes some unnoticed bugs:

  • on reconfigure the *cache_restart() functions were
    called before the DNS listening ports had been
    updated and new nameservers loaded for use.
  • the fqdn cache manager report was registered as
    available for use when the component was disabled.
  • parsing of /etc/hosts is moved to the DNS component
    Matching /etc/resolv.conf, etc. load functions.

@yadij yadij requested a review from rousskov February 19, 2026 23:47
@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 19, 2026
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.

This review is not comprehensive. I plan to come back to this PR after the backlog is dealt with.

I continue to beg you to stop posting new PRs until we find a way to deal with the large and growing backlog.

void bootstrapConfig() override {
// XXX: replace globals
memset(RcodeMatrix, '\0', sizeof(RcodeMatrix));
idns_lookup_hash = hash_create((HASHCMP *) strcmp, 103, hash_string);
Copy link
Contributor

Choose a reason for hiding this comment

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

These initialization steps are not necessary for configuration parsing and, hence, do not belong to bootstrapConfig() event. Most likely, idns_lookup_hash should be created like the other two hashes affected by this PR scope (fqdn_table and ip_table).

idnsInitialize()
{
static int init = 0;
idnsParseEtcHosts();
Copy link
Contributor

Choose a reason for hiding this comment

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

When working on improving this code, please do not add more configuration parsing steps into socket opening code. Squid should parse/validate configuration and then (if validation is successful) apply it (e.g., by closing and opening configuration-dependent sockets).

ipcache_low = (long) (((float) Config.ipcache.size *
(float) Config.ipcache.low) / (float) 100);
n = hashPrime(ipcache_high / 4);
auto n = hashPrime(ipcache_high / 4);
Copy link
Contributor

Choose a reason for hiding this comment

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

If you are polishing how n is declared, please improve its const-correctness. The same applies to another function where PR changes how n is declared.

@rousskov rousskov removed the S-waiting-for-reviewer ready for review: Set this when requesting a (re)review using GitHub PR Reviewers box label Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments