Retry transient statuses
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- go
- 领域
- build-system
调研方向
Start with internal/devpkg/narinfo_cache.go, especially fetchNarInfoStatusFromHTTP, areExpectedOutputsInCacheOnce, and FillNarInfoCache; then trace how internal/devpkg/package.go handles a cache miss. The issue suggests several possible remedies, so clarify the chosen scope before changing behavior. Done means transient HTTP failures are not silently treated as genuine cache misses, with the selected behavior covered by relevant tests.
由索引模型根据 Issue 内容生成。
描述
What problem are you trying to solve?
A single transient non-200 from cache.nixos.org makes devbox run fail hard, even
when every store path is already present in the local nix store.
On a GitHub Actions runner, with the whole /nix/store restored from cache moments
earlier:
Info: Ensuring packages are installed.
Error: error running script "echo" in Devbox: execute template flake.nix.tmpl:
template: flake.nix.tmpl:52:33: executing "flake.nix.tmpl" at
<$pkg.InputAddressedPathForOutput>: error calling InputAddressedPathForOutput:
Package "gdk-pixbuf@latest" cannot be fetched from binary cache store
All six gdk-pixbuf x86_64-linux store paths in our devbox.lock return 200 from
cache.nixos.org, before and after the failure. Re-running the identical job, same
commit, same lockfile, succeeded with no changes. Out of 45 jobs in that CI run using
the same lockfile at the same moment, exactly one failed.
Root cause
fetchNarInfoStatusFromHTTP treats any non-200 as "this path is not in the cache"
(internal/devpkg/narinfo_cache.go:228):
return res.StatusCode == http.StatusOK, nil
A 429, 503 or 403 from the CDN is therefore recorded identically to a genuine
404. There is no retry, and the request carries a 5s deadline
(narinfo_cache.go:216).
That result then propagates as fact:
areExpectedOutputsInCacheOnce(narinfo_cache.go:89) requires every default
output to be present:len(outputToCache) == len(outputs).- Packages with two default outputs need 2/2 hits. In our lock that's
gdk-pixbuf
(out+man), plusffmpeg,gnumake,just,libheif,perl,
pkg-configandqpdfso they lose twice as often. IsInBinaryCachereturns false, andInputAddressedPathForOutput
(internal/devpkg/package.go:604) aborts template rendering.
Concurrency makes a transient response much more likely. FillNarInfoCache
(narinfo_cache.go:51, called from internal/shellgen/flake_plan.go:43) uses an
unbounded errgroup one goroutine per package output. Our devbox.lock has 88
x86_64-linux outputs, so devbox opens 88 concurrent requests to cache.nixos.org from
one IP, every time.
The frustrating part: in CI, every one of those paths was already in the local nix
store from a restored cache. The build could not have needed the network at all.
What solution would you like?
In rough order of value:
- Only
404means absent. Treat429/5xx/403as inconclusive. Retry, or
surface a real error, rather than silently recording the package as missing. - Retry transient statuses with a small backoff.
- Skip the probe when the store path already exists locally. This is the CI case,
and it makes the common path both faster and network-independent. (Same theme as
#2033.) - Bound the concurrency in
FillNarInfoCache, 88 simultaneous requests to one
host invites rate limiting.
Alternatives you've considered
A wrapper action.
- 主要语言
- Go
- 星标
- 12.4k
- 派生
- 358
- 平均合并
- 17 小时 12 分钟
- 30 天内合并 PR
- 31
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
jetify-com/devbox 的其他 Issue
-
feature triage
难度 2/5 1-3 小时 新手友好度 62/100
jetify-com/devbox#3038 ·
维护者通常 1 天内回复
-
bug p4 package processed triage unrelated
难度 2/5 1-3 小时 新手友好度 66/100
jetify-com/devbox#2898 · 2 条评论 ·
维护者通常 1 天内回复
-
p4 processed unrelated
难度 2/5 1-3 小时 新手友好度 65/100
jetify-com/devbox#2750 · 1 条评论 ·
维护者通常 1 天内回复
-
Storyden未关闭p4 package processed triage unrelated
难度 2/5 1-3 小时 新手友好度 62/100
jetify-com/devbox#2685 · 1 条评论 ·
维护者通常 1 天内回复
-
looks easy p4 package processed triage
难度 2/5 1-3 小时 新手友好度 60/100
jetify-com/devbox#2656 · 1 条评论 ·
维护者通常 1 天内回复
查看 jetify-com/devbox 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
riverqueue/river#1576 ·
维护者通常 1 天内回复
-
NFS StorageProvider renders a missing nfsSubDir as "<no value>"可能已有人在做 @ldming 今天认领。 未关闭kind/bug
难度 2/5 1-3 小时 新手友好度 82/100
apecloud/kubeblocks#11067 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
emersion/go-msgauth#87 ·
-
CLI: `describe <ns>.<table>` reports "namespace does not exist" when only the table is missing可能已有人在做 @Shruthirdy 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
apache/iceberg-go#2423 ·
维护者通常 2 天内回复
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 85/100
mafzalkalwardev/mailforge#21 ·