Skip to content

Make response write and artifact download timeouts configurable - #531

Merged
andrew merged 1 commit into
git-pkgs:mainfrom
profiling:feat/configurable-artifact-timeouts
Oct 19, 2026
Merged

andrew merged 1 commit into
git-pkgs:mainfrom
profiling:feat/configurable-artifact-timeouts

Conversation

@profiling

Copy link
Copy Markdown
Contributor

Closes #530.

Cold artifact requests can spend more than five minutes downloading and scanning before returning a response. Both the response write deadline and upstream artifact download timeout currently use the same hard-coded five-minute value, so increasing scanning.timeout cannot extend the response deadline.

This adds independent write_timeout and artifact_timeout settings, with PROXY_WRITE_TIMEOUT and PROXY_ARTIFACT_TIMEOUT environment overrides. Both default to 5m; "0" disables the corresponding timeout, and malformed or negative values are rejected at startup. Existing metadata and scanning settings, transport safeguards, and unlimited CLI mirror downloads retain their behavior.

write_timeout: "18m"
artifact_timeout: "10m"

The configuration reference explains that the write deadline includes time spent waiting for downloads and scans. Tests cover YAML/JSON loading, environment precedence, validation, real HTTP deadline behavior, and CLI mirror downloads with short serve-only timeouts configured.

Validation on Linux with Go 1.26.7:

  • go test -race ./...
  • go vet ./...
  • go build ./...
  • golangci-lint run ./... (v2.13.1; zero issues)
  • Changed Go files pass gofmt; git diff --check passes.

PostgreSQL integration tests were skipped because PROXY_DATABASE_URL was unset. The macOS and Windows test matrix remains for CI.

Add independent write_timeout and artifact_timeout settings with environment overrides and unchanged five-minute defaults. Keep mirror downloads unlimited and validate timeout values.

Refs git-pkgs#530

@andrew andrew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified independent response and artifact timeouts through the running server, including delayed scanning and disabled timeouts. No blocking findings.

@andrew
andrew merged commit 4de5419 into git-pkgs:main Oct 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make response write and upstream artifact download timeouts configurable

2 participants