bug: Squid 304 revalidation reproduction + deploy debug options - #20
Open
ccijunk wants to merge 2 commits into
Open
bug: Squid 304 revalidation reproduction + deploy debug options#20ccijunk wants to merge 2 commits into
ccijunk wants to merge 2 commits into
Conversation
Welcome To opensourceways CommunityHey @ccijunk , thanks for your contribution to the community. Bot Usage ManualI'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands. Contact GuideIf you have any questions, please contact the SIG: infratructure , |
CLA Signature Passccijunk, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
Linking Issue Notice@ccijunk , the pull request must be linked to at least one issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更内容
TCP_REFRESH_UNMODIFIED_ABORTED(304 +Content-Length: 0)问题复现工具reproduce.sh支持--no-purge模式(对自然过期的缓存条目做重验证,freshness lifetime ≈ 80.8 分钟)vcjob-reproduce.yaml(Volcano 测试任务)、README.md/SUMMARY.md/EXECUTION_LOG.mddebug_options ALL,1 11,2 20,3 28,3 88,3用于排查 revalidation 中断问题product-sample-test分支对齐(CACHE-STRATEGY.md、gy-001/002/wlcb values、去掉 tool/ 测试)说明
304 Not Modified且带Content-Length: 0。200 OK+Content-Length: 0(证据:TCP_REFRESH_UNMODIFIED_ABORTED/200,wgetsaved [0/0],exit 0)。HTTP 客户端不会在 200 时重试,因此这是静默数据损坏:CI 下载到 0 字节产物,直到解压步骤才失败(tar: Error is not recoverable)。上游分析
该问题在上游由 squid-cache/squid#2401 跟踪 — Bug 5538: Do not update Content-Length from 304 responses。下面两个上游 PR 目前均为 open、未合入,Squid master 上 bug 仍然存在。
Content-Length排除在"缓存从 304 更新存储响应时必须采纳(替换已有值)的头部"之外。有缺陷的服务器在 304 中带Content-Length: 0,否则会替换掉正确的已存长度,导致向客户端下发空 body。HttpHeader::skipUpdateHeader()在VARY之外跳过CONTENT_LENGTH。维护者反馈:这只是针对单一症状的创可贴。needUpdate()把Content-Length、ETag、Content-Type、Content-Encoding、Vary当作强表示标识符——若 304 的值与已存储的不一致,则整体拒绝该 304,其头部(包括伪造的Content-Length: 0)一概不应用。同时还能防护 #2401 覆盖不到的 Vary/Content-Type/Encoding 不匹配场景。Content-Length: 202104)——不会回源重下,也不会出现 0 字节响应。skipUpdateHeader增加CONTENT_LENGTH),与当前部署的 Squid 版本兼容,适合快速止血;#2400 是更正确的长期上游修复。本 PR 记录了复现过程、用于诊断问题的 debug 选项,以及针对我们 Squid 部署的上游分析。