Skip to content

Honor requested waits for HTTP VM address lookups - #515

Open
sylvesterkaczmarek wants to merge 2 commits into
openai:mainfrom
sylvesterkaczmarek:fix/honor-http-ip-wait-budget
Open

sylvesterkaczmarek wants to merge 2 commits into
openai:mainfrom
sylvesterkaczmarek:fix/honor-http-ip-wait-budget

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Problem

HTTP VM address lookup requests use the fixed 30-second client timeout even when VMs().IP requests a longer server wait. A requested 120-second wait therefore reaches the transport with a 30-second deadline. The WebSocket path already extends its request timeout to the requested wait plus the usual HTTP allowance.

Change

Share that existing wait-aware client selection with ordinary HTTP requests, and rename the internal helper to reflect both callers. Preserve longer explicitly configured timeouts, disabled client timeouts, and earlier caller-context deadlines. Requests without a wait keep their existing behavior; the shared client is not mutated.

Validation

  • Broad suite excluding VM/runtime integration packages: 124 tests and 101 subtests passed.
  • The client package passes with the race detector. Changed-code lint reports zero issues; git diff --check passes.
  • New tests exercise the public IP method and inspect the effective transport context deadline without sleeping through a long timeout. Two cases fail on unchanged production code; controls cover zero wait, longer/disabled client timeouts, and an earlier caller deadline.
  • The existing WebSocket timeout test remains covered.

Go 1.27.1 on macOS arm64. No real controller, VM, or prolonged network wait was used. No public API, authentication, query-format, or dependency changes.

Go documents how the client-wide timeout covers the complete request in http.Client.

Reproduced against f101ade5d8fdcad5e9c346472698649e7107a715.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

1 participant