Skip to content

Make proxy upstream response-header timeout configurable - #83

Open
mkalkere wants to merge 2 commits into
NVIDIA:mainfrom
mkalkere:fix/configurable-proxy-header-timeout
Open

mkalkere wants to merge 2 commits into
NVIDIA:mainfrom
mkalkere:fix/configurable-proxy-header-timeout

Conversation

@mkalkere

@mkalkere mkalkere commented Sep 14, 2026

Copy link
Copy Markdown

Description

Fixes #57: the 120 s upstream response-header timeout (proxyResponseTimeout) turned any queued or cold model load longer than 120 s into a 502, with no way to raise it and no documentation of the ceiling.

Both proxies (services/ollama-proxy, services/lmstudio-proxy) gain a --response-header-timeout flag. Precedence follows the repo's existing convention: flag > NVPAIR_PROXY_RESPONSE_HEADER_TIMEOUT env > 120 s default. Invalid or non-positive values log a warning and keep the 120 s default (fail-safe). The broker spawns proxies as child processes, so the env var is inherited with zero broker changes. The effective value is still logged at startup on the existing response_header_timeout line.

Scope

Included: both proxies, flag-table rows in both proxy READMEs, docs/proxy-response-header-timeout.mdx, a new troubleshooting section for the 120 s 502s. Excluded: broker changes (none needed) and engine launch-option changes (mentioned by the maintainer separately).

Validation

  • go test -race ./... in both proxy modules: pass.
  • New tests: resolver precedence (default / env / flag-beats-env / invalid / zero / negative) plus transport-picks-up-configured-value, in both proxies.
  • Toolchain: Go 1.26.8 (repo requires Go 1.25+), Linux sandbox. go vet clean, gofmt clean, node scripts/spdx-headers.mjs reports 0 missing headers on every branch.

Risk

None for existing setups: the default is unchanged at 120 s, so this is purely additive. Minor version bumps (0.26.2 -> 0.27.0, 0.16.2 -> 0.17.0) per VERSIONING.md -- additive, user-visible feature.

Checklist

  • I have read the Contributing Guidelines.
  • Every commit is signed off (git commit -s), certifying the Developer Certificate of Origin.
  • New or existing tests cover the change.
  • Relevant documentation is updated.
  • I checked the diff, changed filenames, and commit messages for credentials, private data, internal URLs, internal issue identifiers, and generated artifacts.
  • I recorded the validation commands and results above.
  • I bumped any affected component in services/versions.json, and described user-visible changes above so they reach the release notes.

The 120 s ResponseHeaderTimeout on upstream transports turned queued or cold-loading inference requests into 502s with no way to change it. Add --response-header-timeout (Go duration) to both proxies, falling back to NVPAIR_PROXY_RESPONSE_HEADER_TIMEOUT and then the 120 s default; the broker inherits the env var into its child proxies. Invalid values log a warning and keep the default.

Signed-off-by: mkalkere <14184493+mkalkere@users.noreply.github.com>
Signed-off-by: mkalkere <14184493+mkalkere@users.noreply.github.com>
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.

[Bug]: ollama-proxy: undocumented 120 s upstream response-header timeout turns a queued or cold-loading request into a 502

1 participant