pkgx icon indicating copy to clipboard operation
pkgx copied to clipboard

Auto retrying mechanism for download failures

Open felipecrs opened this issue 7 months ago • 0 comments

I got to admit: https://dist.pkgx.dev has been running rock-solid, and I don't even remember a situation where it caused my CI/CD pipelines to fail.

However, I want to setup my own internal mirror/cache so that I don't need to download so frequently from https://dist.pkgx.dev, using PKGX_DIST_URL.

The problem is: my own internal mirror/cache is not as strong as https://dist.pkgx.dev and often hiccups like break downloads in the middle.

It would be awesome if pkgx implemented some kind of auto retrying mechanism to improve resiliency of pipelines.

Right now, my solution for it is using retry:

$ retry --tries=5 --sleep=15s -- pkgx install openjdk@21
$ retry --tries=5 --sleep=15s -- java --version

But it's bad because:

  1. It retries for failures beyond download failures
  2. I have to have this extra tool installed
  3. Commands are a lot more verbose

felipecrs avatar May 30 '25 18:05 felipecrs