-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplified quick_abort_pct code and improved its docs #1921
Simplified quick_abort_pct code and improved its docs #1921
Conversation
Can one of the admins verify this patch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this ugly code! I support this change in principle (despite the fact that it replaces integer math with floating point math), but it needs a bit more work. Please see my change request for details.
@vshailesh, please also add your contact information to CONTRIBUTORS file (to pass upcoming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for removing the no-longer-necessary code.
Please adjust PR description to briefly document the effect of that removal (e.g., I would expect a slight change in behavior for some setting of quick_abort_pct and possibly other quick_abort_... configuration options). When writing that comment, think as a sysadmin configuring Squid or reviewing their existing configuration (rather than as a Squid developer).
FYI: PR description formatting requirements are available, but most description formatting violations arise from exceeding the 72 character line length limit. Anubis will remove M-failed-description
PR label a few minutes after you fix description formatting. If you cannot format PR description to pass Anubis check, do not worry about it -- we will do it for you.
I also expect that the source maintenance CI check will fail. Please use the diff provided in CI check output (follow the Details link) to adjust your CONTRIBUTORS modifications.
d742055
to
0d4b315
Compare
I have made changes to CONTRIBUTORS as suggested in the diff of CI check. Please retrigger the pipeline. |
0d4b315
to
5239596
Compare
I removed unwanted new line change (that change is visible in
Just FYI: We do not need to keep PR branches in sync with master unless there are merge conflicts or other specific problems that require such synchronization. By default, ignore GitHub suggestions to merge master into your PR branch.
AFAICT, the above request is the only thing left before this PR can be cleared for merging. Thank you! |
Jenkins, it is OK to test this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vshailesh, thank you for providing an example of changed Squid behavior. Your example focuses on quick_abort_pct calculations precision. You were right to disclose that change, but there is an arguably bigger change that the current example overlooks: Please add a brief statement describing whether/how the change affects quick_abort_pct behavior for responses that are smaller than 100 bytes in total message size. There is currently a contradiction between removed if
statement and Squid documentation that this PR should clarify:
- On one hand, code removed by this PR clearly suggests that, prior to this PR, responses smaller than 100 bytes would continue to be fetched (as if quick_abort_pct was set to -1), but now quick_abort_pct is going to be honored for those responses.
- However, quick_abort_pct documentation in src/cf.data.pre continues to say "The cache by default continues downloading aborted requests which are ... less than 16 KB remaining". I do not see any relevant CheckQuickAbortIsReasonable() code, but perhaps that 16 KB check is elsewhere.
If Squid documentation is correct, then let's explicitly say (in the PR description) that the removed if
statement had no effect on quick_abort_pct behavior (for such-and-such reasons). Otherwise, please remove that wrong statement from cf.data.pre and add a brief statement describing whether/how the change affects quick_abort_pct behavior for responses known to be smaller than 100 bytes. Needless to say, you should test to confirm these PR adjustments, whatever they are.
Once all the basic statements are in, I can help polish PR title/description, including its formatting, but I would prefer to rely on you to gather, describe, and validate the basic facts...
CONTRIBUTORS
Outdated
@@ -470,6 +470,7 @@ Thank you! | |||
Sergey Merzlikin <[email protected]> | |||
Sergio Durigan Junior <[email protected]> | |||
Sergio Rabellino <[email protected]> | |||
Shailesh Vashishth <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entry is just fine if you like it, but if you prefer to use some other email address, please note that you can adjust this entry accordingly. Our automation is "smart" enough to allow you to pick the email address you prefer...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried updating to another email, and I am not able to pick another email id. How do I do that?
The source maintenance check failed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am working on fixing this. Please wait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vshailesh, almost done. The current PR branch passes local source maintenance tests, but fails the same tests on GitHub Actions. I know why, but I cannot fix that problem quickly.
For now, would you mind changing/setting your GitHub account email to the one you want to see in CONTRIBUTORS (hopefully, that is the same address that this PR branch has listed in CONTRIBUTORS now)? I hope (but cannot easily test) that such a GitHub account update will change the author of the merge commit that GitHub Actions test, resolving the last remaining problem.
We should be handling your use case better, but that will take time to fix... AFAIK, we have not seen it before.
Since this changes the behaviour of the Squid UI (config setting) this will also need a release notes mention for the |
@vshailesh, I can help with updating release notes once PR description has the necessary disclosures as detailed in my earlier change request. |
@rousskov I went through the code in detail and I did not find any check where we are checking the 16 KB (16384 bytes) statement for any of the
We should remove the statement where it talks about 16 KB lower limit.
I would write some test to check this, and try to build and test on my local system with 100 bytes response, I settle on something and test this. If you meant something else by testing please tell me.
@yadij I would make these changes, once I am done with testing. I may need some help with this. |
It sounds like we are on the same page. Good luck with these additional modifications! Please do not forget to keep PR description in sync with pushed PR branch code changes.
Please update PR description accordingly. This change in Squid behavior might be important in some esoteric use cases, and we have a duty to disclose it.
Your plan to test around 100-byte boundary sounds good to me! I would also test around 16KB boundary. Please do not forget to test both old/official and new/PR code to improve chances that your tests themselves are working as expected. |
@rousskov
Conclusion
@yadij I have tried to update the release notes as well, please review them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If required I can give detailed explanation how I tested this
Not required. Thank you for sharing the details you have already posted!
Please help me with
M-failed-description
Done: The earlier description had a non-ASCII character in we’re
.
I have also update PR title/description (after doing a bit more research on 16KB statement origins) and fixed a few small problems with documentation changes.
@vshailesh, please review my changes. If you disagree with any statements, please discuss. If you can improve anything, please do so.
@rousskov I was trying to fix Contributors file, that is why your approval got rejected, no other changes |
... phrase in the next commit.
This change is a reference point for automated CONTRIBUTORS updates.
CONTRIBUTORS
Outdated
@@ -470,6 +470,7 @@ Thank you! | |||
Sergey Merzlikin <[email protected]> | |||
Sergio Durigan Junior <[email protected]> | |||
Sergio Rabellino <[email protected]> | |||
Shailesh Vashishth <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vshailesh, almost done. The current PR branch passes local source maintenance tests, but fails the same tests on GitHub Actions. I know why, but I cannot fix that problem quickly.
For now, would you mind changing/setting your GitHub account email to the one you want to see in CONTRIBUTORS (hopefully, that is the same address that this PR branch has listed in CONTRIBUTORS now)? I hope (but cannot easily test) that such a GitHub account update will change the author of the merge commit that GitHub Actions test, resolving the last remaining problem.
We should be handling your use case better, but that will take time to fix... AFAIK, we have not seen it before.
@rousskov I have changed my Github settings |
... in hope to get updated author info into that merge commit.
@rousskov Thank you for helping me out with this change. |
Instead of ignoring quick_abort_pct settings that would, together with other conditions, abort a pending download of a 99-byte or smaller response, Squid now honors quick_abort_pct for all response sizes. Most Squids are not going to be affected by this change because default quick_abort_min settings (16KB) prevent aborts of 99-byte responses even before quick_abort_pct is checked. Due to conversion from integer to floating point math, this change may affect responses larger than 99 bytes as well, but these effects ought to be limited to cases where the decision is based on a tiny difference (e.g., receiving 1% more bytes would have triggered full download). In most such cases, the decision could probably go either way due to response header size fluctuations anyway. Also updated quick_abort_pct documentation, primarily to clarify a misleading statement: Squid did not and does not treat 16KB or smaller responses specially in this context. The original statement was probably based on quick_abort_min _default_ setting of 16KB, but statement phrasing and placement hid that connection.
I am glad we are making progress. Now that PR tests are all green, I have cleared this PR for merging and will watch staging tests for failures. |
Authored-by: Shailesh Vashishth [email protected]
Instead of ignoring quick_abort_pct settings that would, together with
other conditions, abort a pending download of a 99-byte or smaller
response, Squid now honors quick_abort_pct for all response sizes. Most
Squids are not going to be affected by this change because default
quick_abort_min settings (16KB) prevent aborts of 99-byte responses even
before quick_abort_pct is checked.
Due to conversion from integer to floating point math, this change may
affect responses larger than 99 bytes as well, but these effects ought
to be limited to cases where the decision is based on a tiny difference
(e.g., receiving 1% more bytes would have triggered full download). In
most such cases, the decision could probably go either way due to
response header size fluctuations anyway.
Also updated quick_abort_pct documentation, primarily to clarify a
misleading statement: Squid did not and does not treat 16KB or smaller
responses specially in this context. The original statement was probably
based on quick_abort_min default setting of 16KB, but statement
phrasing and placement hid that connection.