Conversation
This is a controversial change because it brings no runtime benefits, creates significant cross-branch patch porting headaches and branch maintenance overheads, but it also removes one source of persistent bickering during code review and improves code consistency. Global removal is the only practical way we can remove all HEREs -- restricting removal of HEREs to changed-for-other-reasons lines would take forever. The (simple) script to remove HEREs will be published separately because it is not really needed in this source tree (which no longer uses HERE).
The previous commit auto-removed all HERE uses in debugs() calls.
|
This change has not been tested beyond basic build/startup tests. I am not sure it should be committed (now) but I wanted to share it so that we can finally make this decision. The script to remove HEREs from debugs() calls is available elsewhere. |
yadij
left a comment
There was a problem hiding this comment.
most of these issues should be fixed either by making the script skip the relevant file entirely, or by actively adjusting (eg for the 'broken whitespace' notes).
| return; | ||
| } else { | ||
| debugs(79, DBG_CRITICAL, HERE << "DiskThreadsDiskFile::close: " << | ||
| debugs(79, DBG_CRITICAL, "DiskThreadsDiskFile::close: " << |
There was a problem hiding this comment.
Another example of why HERE cannot be scripted this way.
The DBG_CRITICAL is missing an ERROR or FATAL log prefix, and the hard-coded text "DiskThreadsDiskFile::close: " needs replacing with MYNAME.
There was a problem hiding this comment.
Same answer: This PR automatically removes HERE. Nothing else should be required.
There was a problem hiding this comment.
"Who are you and what have you done with our Alex?"
Seriously though. When kinkie presented a script to do exactly these same HERE replacements, it was you vetoing its application with your insistence on a "perfection or nothing" policy to acceptable changes. Now you are accepting blatantly malformed code lines just because a script left it that way. So please, explain what is behind this complete reversal in your arguments?
There was a problem hiding this comment.
First of all, the script does not create blatantly malformed lines. It does not fix all the problems, but it does not create problems (bugs notwithstanding).
FWIW, I do not recall @kinkie presenting an equivalent solution. That does not mean it did not happen, of course! Please feel free to either encourage him to submit a competing PR or just use my old arguments against me in this PR if you think I was right back then. If I was right back then, then your (i.e., my old) arguments should win. If I was wrong back then, they should be defeated. We are here to select the best solution (among the available ones) and reject bad ones. It should not matter who says something. Our decisions should be based on the merits.
Finally, please note that I started this PR with an explicit disclaimer that it is not clear whether doing these changes is a good idea. If we decide that it is better to keep the status quo, I am content with that. I offered a reasonable alternative so that we can make an informed choice and close this topic one way or the other.
P.S. Please, if at all possible, when you attribute some old actions or decisions to people, please include references. It is trivial to misinterpret something, and context matters.
|
Overall I think this approach is wrong. To do scripted changes we should be applying a patch that adds a working script to scripts/ folder and updates the source-maintenance.sh script to run the cleanup sub-script. Of course the script needs a review of its generated changes before PR approval. Using the above method avoids forcing everyone submitting patches to apply yet another script just in case the audit and QA has issues. The requirement to run source-maintenance as a pre-PR check is still relevant to find small issues. Note that this still precludes abruptly dropping the macro definition - we have a long transition period still ahead while old code gets ported upwards and its existence is there to ease that process. Finally reaching agreement or tipping-point on the bulk conversion is only day 2 of a multi-year process. FYI: I am in the process of adjusting the source-maintenance to submit PR with changes rather than straight committing them, so we still get review of bulk changes at that stage. It is currently identifying about a dozen things the recent PR have done wrong and auditors did not spot manually. So dropping it entirely at this stage does not appear to be a good option. |
I do not know what you mean by "this approach", but I think that we only have two in-scope options on the table:
I do not see a third viable option, but I would be happy to hear it.
That does not compute for me. After we remove We can certainly add code and/or tools to police and/or format debugs() statements, but that work is outside this PR scope (and needs preliminary discussions). Removal of
This PR does not force anybody to apply any new scripts to any patches either.
I propose to drop HERE definition from master. Any PRs containing HERE that want to land in master after this PR is merged can be easily fixed IMO. I see no significant value in "easing the process" of sneaking in debugs() lines with HERE into master, and I certainly see harm from doing so -- we do not want to manually police PRs for HERE presence. Can you give a few specific examples where removing HERE definition from master would create serious problems? I think we should also drop HERE from v4 but it is your call. It is probably too late for v3.5.
Sounds good. Long-term, missing source maintenance will become one of the pre-merge checks, very similar to the current |
|
To summarize the current status: I believe that
@yadij, how do you want to proceed? |
|
@yadij, now that we are branching off v5, it would be a good time to revisit removal of HERE tokens. If you are ready to accept the natural limitations of the HERE removal script, I can update it to work for the current code to get rid of HERE in both v5 and master. |
|
I have been holding off on re-evaluating this until the PR #531 is merged. After that this huge changeset reduces down to a few lines adding replacement rules to the code filter. |
I see. Unfortunately, I doubt we should remove |
|
#653 is competing with this old PR. I believe that, out of the two options, this PR's approach is the best way forward. I summarized those thoughts in #653 (review). If I am right, then I would be happy to sync this old PR (and the corresponding script) with the current code and, in a separate PR, remove any exceptional HEREs that require manual attention. |
|
The same scripting approach is now used in #881. No need to keep this stale PR open anymore. |
|
FYI, I left this open because the manual changes here are not part of #881. |
This is a controversial change because it brings no runtime benefits,
creates significant cross-branch patch porting headaches and branch
maintenance overheads, but it also removes one source of persistent
bickering during code review and improves code consistency. Global
removal is the only practical way we can remove all HEREs -- restricting
removal of HEREs to changed-for-other-reasons lines would take forever.
The (simple) script to remove HEREs will be published separately because
it is not really needed in this source tree (which no longer uses HERE).
This pull request has two commits that should not be squashed IMO. One
automatically removes HERE usage (using a script) and another manually
removes HERE declarations.