fix(rest-api): Retry HTTP/2 INTERNAL_ERROR streams over HTTP/1.1 - #5646
fix(rest-api): Retry HTTP/2 INTERNAL_ERROR streams over HTTP/1.1#5646kfelternv wants to merge 1 commit into
Conversation
Signed-off-by: Kyle Felter <kfelter@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
What changedPASS for Scenario and setupThe regression uses a local TLS server that accepts HTTP/2 and HTTP/1.1. It commits an HTTP 200 response and resets the HTTP/2 stream, then returns valid JSON for the HTTP/1.1 retry. The built nicocli command was exercised with the same organization, bearer-header presence, path, and
VerificationStep 1: Reproduce the reported failure before the retryWhy this step exists: It proves the focused regression reaches the same response-read failure reported in #4673. Runnable command: go test ./cli/pkg -run '^TestClient_Do$' -count=1Observed result on base Why this proves the behavior: The failure is returned by the same Step 2: Verify the retry and no-retry safeguards at the PR headWhy this step exists: It covers the successful HTTP/1.1 retry, one-attempt limit, mutation exclusion, unrelated read-error exclusion, and failed-body close. Runnable command: go test -race ./cli/pkg -count=1Observed result: Why this proves the behavior: The table asserts request protocols Step 3: Exercise the built nicocli commandWhy this step exists: It verifies the compiled command through the user-facing noninteractive interface rather than only calling the client package directly. Runnable command: SSL_CERT_FILE=./server.crt NICO_BASE_URL=https://localhost:18473 NICO_ORG=test-org NICO_TOKEN='<redacted>' ./nicocli instance list --page-size 100 --output tableObserved result: Why this proves the behavior: The built CLI preserved the request path, query, and authorization header, retried once with HTTP/1.1 after the HTTP/2 reset, and exited successfully. |
This is a client-side mitigation for #4673, not a fix for the unknown server-side reset. When the shared nicocli client used by the command and TUI receives the exact HTTP/2
INTERNAL_ERRORon a GET, it retries once over HTTP/1.1 with the same request path, query, authorization, and timeout; mutations and unrelated errors are not retried.Related issues
Type of Change
Breaking Changes
Testing
Unit tests added/updated
Integration tests added/updated
Manual testing performed
No testing required (docs, internal refactor, etc.)
go test -race ./cli/pkg -count=1go vet,golangci-lint,staticcheck,errcheck,ineffassign,unused, andreviveon./cli/pkgBuilt
nicocliand raninstance list --page-size 100 --output tableagainst a local TLS server that reset HTTP/2 and returned the same request successfully over HTTP/1.1The broader
go test -race ./cli/... -count=1remains blocked by an existing TUI resource-policy test failure that also reproduces on cleanmainAdditional Notes
ytl-dev2, other deployed environments, and the interactive TUI were not exercised. This change only recovers the observed failure when the same GET succeeds over HTTP/1.1; it does not identify or repair the server-side cause of the reset.