-
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
Do not mark successful FTP PUT entries with ENTRY_BAD_LENGTH #1904
Do not mark successful FTP PUT entries with ENTRY_BAD_LENGTH #1904
Conversation
ba3fe8d commit introduced a mechanism allowing to mark complete responses and treating all other responses as truncated. It missed one case when the FTP server responds with 226 or 250 code after getting a complete PUT request.
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. If possible, please adjust PR description to add a partial1 access.log record sample to illustrate the admin-visible effects and the scope of the fixed bug.
Footnotes
-
I am thinking something like
%Ss/%03>Hs %rm %ru %err_code/%err_detail
with%err_code/%err_detail
part removed if it expands to-/-
in this case. ↩
The only admin-visible effect is the |
Interesting. I assume that affected ERR_FTP_PUT_CREATED responses are not cachable even when not marked as incomplete, so I am not surprised that incorrect ENTRY_BAD_LENGTH marking does not affect future hits -- there can be no hits here. How about HTTP connection persistency? In other words, if the HTTP client signals that it will keep the connection open/persistent after this PUT request,
Noted. On one hand, this is probably just a corner case because the actual stored HTTP response body is complete here -- Ftp::Gateway (i.e. ftpSendReply) generates ERR_FTP_PUT_CREATED HTTP response and stores all of its bytes in the corresponding StoreEntry. On the other hand, we should double check whether access.log record reflects truncation if that response with ENTRY_BAD_LENGTH does get truncated during storage for some reason (e.g., some kind of internal Store forwarding bug or error like inconsistent index state or lack of RAM). Would Squid close HTTP connection to signal truncation to the HTTP client and then log something special to access.log if Store does not store the last ERR_FTP_PUT_CREATED body byte and turns ENTRY_BAD_LENGTH flag on? To avoid misunderstanding, even if we need to fix some other bugs based on the discussion/investigations above, this minimal PR is ready to be merged IMO. I am clearing it for merging after polishing its description a little.
Yes, of course. In the context of this discussion, we are only interested in admin- or agent-observable effects outside of debugging logs. |
Since 2021 commit ba3fe8d, we explicitly mark complete responses and treat all other responses as truncated. That commit missed a case where the FTP server responds with 226 or 250 code after receiving the upload. The bug affects HTTP PUT requests using ftp URI scheme. Incorrect truncation marking adds an unwanted WITH_CLIENT %err_detail to ERR_FTP_PUT_CREATED transaction records in access.log: 201 PUT ftp://... ERR_FTP_PUT_CREATED/FTP_REPLY_CODE=226+WITH_CLIENT Fixed code logs: 201 PUT ftp://... ERR_FTP_PUT_CREATED/FTP_REPLY_CODE=226
…ache#1904) Since 2021 commit ba3fe8d, we explicitly mark complete responses and treat all other responses as truncated. That commit missed a case where the FTP server responds with 226 or 250 code after receiving the upload. The bug affects HTTP PUT requests using ftp URI scheme. Incorrect truncation marking adds an unwanted WITH_CLIENT %err_detail to ERR_FTP_PUT_CREATED transaction records in access.log: 201 PUT ftp://... ERR_FTP_PUT_CREATED/FTP_REPLY_CODE=226+WITH_CLIENT Fixed code logs: 201 PUT ftp://... ERR_FTP_PUT_CREATED/FTP_REPLY_CODE=226
Since 2021 commit ba3fe8d, we explicitly mark complete responses and
treat all other responses as truncated. That commit missed a case where
the FTP server responds with 226 or 250 code after receiving the upload.
The bug affects HTTP PUT requests using ftp URI scheme.
Incorrect truncation marking adds an unwanted WITH_CLIENT %err_detail to
ERR_FTP_PUT_CREATED transaction records in access.log:
Fixed code logs: