Retry transient statuses
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- build-system
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 12.4k
- Fork
- 358
- Merge trung bình
- 17 giờ 12 phút
- Pull request đã merge (30 ngày)
- 31
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của jetify-com/devbox
-
feature triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jetify-com/devbox#3038 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pulumi is outdatedĐang mởbug p4 package processed triage unrelated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
jetify-com/devbox#2898 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
p4 processed unrelated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
jetify-com/devbox#2750 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
StorydenĐang mởp4 package processed triage unrelated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jetify-com/devbox#2685 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Plugin Request]: apacheKafkaĐang mởlooks easy p4 package processed triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
jetify-com/devbox#2656 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của jetify-com/devbox
Issue tương tự
-
area: frontend priority: normal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
TestAutonomousStop_ReportsObservedState fails under host load: 1s wall-clock ceiling vs 250ms cycleĐang mởtype:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
nightgauge/nightgauge#2909 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jasonfen/terminal-space-program#842 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MustacheCase/zanadir#521 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
v3.1.0: spread placement groups fail — label key uses the reserved hetzner.cloud prefixCó thể đã có người làm @ScrimReaper đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
stubbi/karpenter-provider-hetzner#120 ·
Maintainer thường phản hồi trong vòng 4 ngày