Skip to content

fix(middleware): preserve HTTP request failure causes - #4145

Open
shiju-nv wants to merge 1 commit into
feat/2431-http-middleware-protocol-2/pimlockfrom
fix/middleware-request-failure-causes-20261002
Open

shiju-nv wants to merge 1 commit into
feat/2431-http-middleware-protocol-2/pimlockfrom
fix/middleware-request-failure-causes-20261002

Conversation

@shiju-nv

@shiju-nv shiju-nv commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

HTTP request middleware retains fixed failure categories separately from diagnostic messages and explicit service denials. Live forwarding also records when upstream writing starts, including a write that fails after partial progress.

This adds the internal cause and delivery primitives. Exposing them in every caller result and serialized event remains with the companion tracing work.

Related Issue

Part of #4144. Stacked on #4359.

Land #4359 first. After its squash merge, replay only this layer onto main and verify the resulting diff.

Changes

  • Preserve local deadline scope, remote gRPC status, unavailable bindings, capacity limits, invalid output, I/O and cancellation without retaining remote messages or metadata.
  • Carry causes through hook diagnostics and compacted stage records. Preserve request-level timeout and cancellation when stage records succeeded.
  • Distinguish oversized DUPLEX output from invalid output while retaining the existing diagnostic text and sandbox failure codes.
  • Track local forwarding as not started, started or completed through the existing upstream writer. Completion does not establish upstream receipt or processing.
  • Preserve enforcement, response selection and retries.

Release Notes

Middleware retains structured failure attribution and local delivery progress for downstream observation.

Testing

  • Checks appropriate to the affected code and behavior pass
  • Unit tests added/updated (if applicable)
  • E2E tests added/updated (if applicable)

Eight focused middleware tests, three focused network tests and scoped Clippy for both packages' library and test targets pass. Removing capacity classification fails the regression with InvalidResult versus Capacity; dropping the request-level cause fails with None versus RequestBodyTimeout. Formatting, SPDX and independent source review pass.

The focused tests do not run the complete live relay or real whole-body and idle expiry. E2E coverage is requested with test:e2e; no final-head E2E pass is claimed yet.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

@github-actions

Copy link
Copy Markdown

This pull request has had no activity for 14 days and is now marked stale.

@github-actions github-actions Bot added the state:stale Inactive item at risk of automatic closure. label Oct 20, 2026
@shiju-nv shiju-nv added the test:e2e Requires end-to-end coverage label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Label test:e2e applied for 9a62429. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway, sandbox, and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

Retain typed local deadline and remote failure causes through HTTP hook diagnostics and request handling. Track local upstream write progress through the existing live writer, including partial failures. Preserve response selection, diagnostic text and request retries.

Refs #4144

Build on PR #4359. Caller and event exposure remains with the companion tracing work.

Signed-off-by: Shiju <shiju@nvidia.com>
@shiju-nv
shiju-nv force-pushed the fix/middleware-request-failure-causes-20261002 branch from 9a62429 to bd0b5ba Compare November 2, 2026 14:46
@copy-pr-bot

copy-pr-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@shiju-nv
shiju-nv removed this pull request from stack #4146 November 2, 2026 14:52
@shiju-nv
shiju-nv changed the base branch from feat/2431-streaming-request-middleware/pimlock to feat/2431-http-middleware-protocol-2/pimlock November 2, 2026 14:52
@shiju-nv
shiju-nv added this pull request to stack #5124 November 2, 2026 14:52
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

@shiju-nv

shiju-nv commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test bd0b5ba

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

state:stale Inactive item at risk of automatic closure. test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants