Skip to content

Conversation

@yadij
Copy link
Contributor

@yadij yadij commented Nov 29, 2025

No description provided.

@yadij yadij added M-cleared-for-merge https://github.com/measurement-factory/anubis#pull-request-labels S-could-use-an-approval An approval may speed this PR merger (but is not required) labels Nov 29, 2025
kinkie
kinkie previously approved these changes Nov 29, 2025
Copy link
Contributor

@kinkie kinkie left a comment

Choose a reason for hiding this comment

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

nice!

@rousskov rousskov self-requested a review November 30, 2025 14:43
@rousskov rousskov changed the title Maintenance: update mcast_groups to SBufList update mcast_groups to SBufList Nov 30, 2025
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 plan to come back to this new PR after the backlog is cleared. FWIW, my earlier repeated requests to stop posting such PRs still stand.

P.S. I removed "Maintenance" prefix from PR title because this PR does change running code in non-trivial ways.

size_t tcpRcvBufsz;
size_t udpMaxHitObjsz;
wordlist *mcast_group_list;
SBufList mcast_group_list;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not add non-POD data members to SquidConfig. That class must be a POD because the global configuration object is accessed before main() starts and after main() exits1. Our NoNewGlobals policy essentially applies to SquidConfig data members. SquidConfig is already documented to be a POD. Several existing data members violate this rule and that documentation2, but we should not make the problem more difficult to fix by adding new violations.

AFAICT, the correct new type for mcast_group_list data member is a raw pointer to SBufList. Unfortunately, more code changes are required to support that new type in current code, but nothing major.

Footnotes

  1. For an example of problems caused by non-POD Config members, see recent commit c565067 that fixes one of those problems.

  2. We probably just did not know better when we added them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI: SquidConfig has contained other SBufList for a year now without problems. So has already been proven safe for this particular global usage.

FTR: the issues requiring strictly POD-only members have been resolved since Squid v4 (3b1439d). Objects which use MEMPROXY allocation and are default constructable can be used, at least as members of existing globals now.

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 issue(s) behind c565067 were that values within the post initialization SSL_CTX are not global safe. The ContextPointer itself should be global-safe, but the context it was pointing to needed to be deleted explicitly at a certain timing/order.

Copy link
Contributor

Choose a reason for hiding this comment

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

FTR: the issues requiring strictly POD-only members have been resolved since Squid v4 (3b1439d).

The "issues" are C++ global object construction and destruction rules. They cannot be resolved without changing the language itself.

@rousskov rousskov removed M-cleared-for-merge https://github.com/measurement-factory/anubis#pull-request-labels S-could-use-an-approval An approval may speed this PR merger (but is not required) labels Nov 30, 2025
@yadij
Copy link
Contributor Author

yadij commented Nov 30, 2025

P.S. I removed "Maintenance" prefix from PR title because this PR does change running code in non-trivial ways.

"trivial" is not required for something to be maintenance. FYI, this PR is enacting software maintenance process step 5 migration - deprecated/obsolete wordlist is being replaced.

That step is also commonly called/described as "preventative maintenance: Refactoring the codebase to improve efficiency, readability, and maintainability, and make it less prone to errors."

@yadij yadij changed the title update mcast_groups to SBufList Maintenance: update mcast_groups to SBufList Nov 30, 2025
@yadij yadij requested a review from rousskov November 30, 2025 17:45
@kinkie
Copy link
Contributor

kinkie commented Nov 30, 2025

I agree with keeping the PR title as is

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.

Alex: I removed "Maintenance" prefix from PR title because this PR does change running code in non-trivial ways.

Amos: "trivial" is not required for something to be maintenance.

Very true, but I am against using "Maintenance" PR title prefix for such non-trivial changes. IIRC, I have already detailed the reasons behind my preference, probably more than once.

Francesco: I agree with keeping the PR title as is

Sigh. Counting votes is not how we should resolve differences in opinion, IMHO.

size_t tcpRcvBufsz;
size_t udpMaxHitObjsz;
wordlist *mcast_group_list;
SBufList mcast_group_list;
Copy link
Contributor

Choose a reason for hiding this comment

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

FTR: the issues requiring strictly POD-only members have been resolved since Squid v4 (3b1439d).

The "issues" are C++ global object construction and destruction rules. They cannot be resolved without changing the language itself.

@kinkie
Copy link
Contributor

kinkie commented Dec 1, 2025

Francesco: I agree with keeping the PR title as is

Sigh. Counting votes is not how we should resolve differences in opinion, IMHO.

It can be if other options fail, but that was not the message I was aiming for.
Let me try to word it differently:

I don't think such a trivial change is something that is worth holding up a PR on.
As such, I will defer to whatever the author of the PR picks, as they have put in the work, their code beats my opinions anyway.

@rousskov
Copy link
Contributor

rousskov commented Dec 1, 2025

I don't think such a trivial change is something that is worth holding up a PR on. As such, I will defer to whatever the author of the PR picks, as they have put in the work, their code beats my opinions anyway.

Understood. Thank you for confirming that my attempts to explain why (or even relay that) title prefixes are not a trivial matter for me have failed.

@kinkie
Copy link
Contributor

kinkie commented Dec 1, 2025

I don't think such a trivial change is something that is worth holding up a PR on. As such, I will defer to whatever the author of the PR picks, as they have put in the work, their code beats my opinions anyway.

Understood. Thank you for confirming that my attempts to explain why (or even relay that) title prefixes are not a trivial matter for me have failed.

Trivial != unimportant. I don't think they're trivial but if I am to list components of a PR in descending order of importance for me, I have:

  1. the code (duh)
  2. code tests
  3. PR title (without prefixes)
  4. PR description
  5. code comments
  6. PR discussion
  7. PR prefixes

Nothing is trivial, but for me, I'd generally request changes for 1-3, suggest changes for 4-5 and maybe drop a comment for 7 (6 is important but can't be changed, obviously)

@rousskov
Copy link
Contributor

rousskov commented Dec 1, 2025

I don't think such a trivial change is something that is worth holding up a PR on. As such, I will defer to whatever the author of the PR picks, as they have put in the work, their code beats my opinions anyway.

Understood. Thank you for confirming that my attempts to explain why (or even relay that) title prefixes are not a trivial matter for me have failed.

Trivial != unimportant. I don't think they're trivial but if I am to list components of a PR in descending order of importance for me, I have:

1. ...
7. PR prefixes 

Nothing is trivial, but for me, I'd generally request changes for 1-3, suggest changes for 4-5 and maybe drop a comment for 7 (6 is important but can't be changed, obviously)

I understand that prefixes are the least important item for you. I wish the fact that prefixes are important for me would change your authors-choice treatment, but I obviously lost that battle.

@kinkie
Copy link
Contributor

kinkie commented Dec 1, 2025

I understand that prefixes are the least important item for you. I wish the fact that prefixes are important for me would change your authors-choice treatment, but I obviously lost that battle.

You may have failed to convince me that it's worthwhile holding up a PR on prefixes, but at the same time I'm not forcing your (or anyone else's) behaviour. It's fine to have different viewpoints

@rousskov
Copy link
Contributor

rousskov commented Dec 2, 2025

I understand that prefixes are the least important item for you. I wish the fact that prefixes are important for me would change your authors-choice treatment, but I obviously lost that battle.

You may have failed to convince me that it's worthwhile holding up a PR on prefixes, but at the same time I'm not forcing your (or anyone else's) behaviour.

I was hoping for your assistance with reducing my overheads1, but "not forcing your behaviour" is certainly better than some of the alternatives I can easily imagine. Thank you for that!

convince me that it's worthwhile holding up a PR on prefixes

Just to avoid a misunderstanding: My negative votes for this PR were not due to this PR title prefix.

Footnotes

  1. In an area where others did not voice strong preferences.

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.

3 participants