WIP: Implement package fetch retries #30171
No reviewers
Labels
No labels
abi/f32
abi/ilp32
abi/n32
abi/sf
abi/x32
accepted
arch/1750a
arch/21k
arch/6502
arch/a29k
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/avr32
arch/bfin
arch/bpf
arch/clipper
arch/colossus
arch/cr16
arch/cris
arch/csky
arch/dlx
arch/dsp16xx
arch/elxsi
arch/epiphany
arch/fr30
arch/frv
arch/h8300
arch/h8500
arch/hexagon
arch/hppa
arch/hppa64
arch/i370
arch/i860
arch/i960
arch/ia64
arch/ip2k
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/maxq
arch/mcore
arch/metag
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/mn10200
arch/mn10300
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/nios2
arch/ns32k
arch/nvptx
arch/or1k
arch/pdp10
arch/pdp11
arch/pj
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390
arch/s390x
arch/sh
arch/sh64
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/st200
arch/starcore
arch/tilegx
arch/tilepro
arch/tricore
arch/ts
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/we32k
arch/x86
arch/x86_16
arch/x86_64
arch/xcore
arch/xgate
arch/xstormy16
arch/xtensa
autodoc
backend/c
backend/llvm
backend/self-hosted
binutils
breaking
build system
debug info
docs
error message
frontend
fuzzing
incremental
lib/c
lib/compiler-rt
lib/cxx
lib/std
lib/tsan
lib/ubsan-rt
lib/unwind
linking
miscompilation
os/aix
os/android
os/bridgeos
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/kfreebsd
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/solaris
os/tvos
os/uefi
os/visionos
os/wali
os/wasi
os/watchos
os/windows
os/zos
proposal
release notes
testing
tier system
zig cc
zig fmt
bounty
bug
contributor-friendly
downstream
enhancement
infra
optimization
question
regression
upstream
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ziglang/zig!30171
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "joshua-holmes/zig:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The original PR is in GitHub.
Overview
Like in GitHub issue #17472, the package manager does not retry fetching when communication to the server fails in a way that could possibly be resolved by retrying the fetch.
Solution
lib/std/time/epoch.zig, which was necessary to convert date to epoch secondsTesting
I unit tested quite a bit of the new code, and the tests pass. I also tested this locally with and without network failures, while logging before and after the delays to see that the number matched with real delay. I also tested this with a local endpoint that includes a "Retry-After" header. All works really well.
That being said, I have rebased a few times since doing all that testing and have only lightly tested my code since the rebases. Trying to keep my PR up to date is time consuming and testing it every time is more time consuming. But so far my light tests have worked and I'm happy to perform my thorough tests again at any time. I am doubtful the rebases have introduced a bug, though.
u16instead ofu32forretry_count25b40ef743Client.connect()7b1e1cc104`ConnectTcpError` is a subset of `ConnectError`, but the 4 additional errors that `ConnectError` comes with: ```zig error{ UnsupportedUriScheme, UriMissingHost, UriHostTooLong, CertificateBundleLoadFailure, } ``` ...are never returned by `Client.connect()`. So we are communicating that this method could return 1 of those 4 types, when in reality, it never can. This commit fixes this communication error.std.time.epochto getstd.Io.Timestampfrom datetime 49ba654985Retryunit tests deaac30e64226176018e66b7e1a20emasterto WIP: master66b7e1a20eacc55ae3b6WIP: masterto masterNote that
masteron Codeberg and GitHub have diverged;a493e7923eis not on Codeberg. So you will need to rebase this PR on Codebergmaster.masterto Implement package fetch retries@alexrp thanks for letting me know, I have already done so.
acc55ae3b607eb2a2f1607eb2a2f16021910f65d021910f65d8ad6fbdb01Implement package fetch retriesto WIP: Implement package fetch retries8ad6fbdb013384e8c22f3384e8c22fd137fd040bd137fd040bee2fa2b971ee2fa2b9710b6222945f0b6222945f1abdae75411abdae75414cacf87dcfView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.