Skip to content

feat(worker-proxy): proxy extension gRPC calls - #11961

Open
Jacob Viau (jviau) wants to merge 5 commits into
u/jviau/relay-extension-rpc-streamsfrom
u/jviau/extension-grpc-ingress
Open

feat(worker-proxy): proxy extension gRPC calls#11961
Jacob Viau (jviau) wants to merge 5 commits into
u/jviau/relay-extension-rpc-streamsfrom
u/jviau/extension-grpc-ingress

Conversation

@jviau

Copy link
Copy Markdown
Contributor

Issue describing the changes in this PR

N/A. This is layer 3 of the WorkerProxy extension-RPC stack and follows #11959.

Pull request checklist

IMPORTANT: Currently, changes must be backported to the in-proc branch to be included in Core Tools and non-Flex deployments.

  • Backporting to the in-proc branch is not required
    • Otherwise: Link to backporting PR
  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes do not require diagnostic events changes
    • Otherwise: I have added/updated all related diagnostic events and their documentation (Documentation issue linked to PR)
  • I have added all required tests (Unit tests, E2E tests)

Additional information

Layer 3 ports telemetry-free WorkerProxy extension gRPC ingress above preceding PR #11959. It relays opaque gRPC frames and metadata over the extension RPC stream, enforces transport limits, flow control, cancellation, deadlines, and status/trailer propagation. Metrics and activity enrichment remain intentionally deferred to layer 4.

@jviau
Jacob Viau (jviau) requested a review from a team as a code owner September 1, 2026 21:31
@jviau Jacob Viau (jviau) added the compute-separation Compute separation / external worker support label Sep 1, 2026
Copilot AI lite review requested due to automatic review settings September 2, 2026 16:10
@jviau
Jacob Viau (jviau) force-pushed the u/jviau/extension-grpc-ingress branch from 14e7bdb to 5d297e8 Compare September 2, 2026 16:10

Copilot AI 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.

🟡 Changes recommended

There are compile-breaking issues in the new ingress (array sizing with uint) and the new test stub (IHttpResponseTrailersFeature missing Available).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds worker-facing extension gRPC ingress to WorkerProxy by relaying opaque gRPC frames and metadata over the already-established Extension RPC stream (layer 3 of the extension-RPC stack).

Changes:

  • Introduces ExtensionGrpcIngress to translate HTTP/gRPC framing + metadata into ExtensionRpcMessage start/data/half-close and to translate response headers/data/trailers back to gRPC.
  • Wires the ingress into the WorkerProxy HTTP pipeline so worker-facing native gRPC calls are intercepted and proxied over the extension RPC stream.
  • Adds unit tests covering basic relay, invalid framing, negotiated limit violations, deadline while negotiating, and disconnect behavior.
File summaries
File Description
test/Functions.WorkerProxy.Tests/ExtensionGrpcIngressTests.cs Adds unit tests for extension gRPC ingress framing, metadata propagation, limits, deadlines, and disconnect handling.
src/Functions.WorkerProxy/WorkerProxyApplication.cs Registers ExtensionGrpcIngress and adds middleware to route eligible requests into the ingress handler.
src/Functions.WorkerProxy/ExtensionGrpcIngress.cs Implements the ingress relay logic, including framing parsing, metadata mapping, timeout parsing, cancellation/deadline behavior, and status/trailer propagation.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Functions.WorkerProxy/ExtensionGrpcIngress.cs
Comment thread test/Functions.WorkerProxy.Tests/ExtensionGrpcIngressTests.cs
Comment thread src/Functions.WorkerProxy/ExtensionGrpcIngress.cs Outdated
@jviau
Jacob Viau (jviau) force-pushed the u/jviau/extension-grpc-ingress branch from 5d297e8 to ab71636 Compare September 2, 2026 17:20
@jviau
Jacob Viau (jviau) force-pushed the u/jviau/extension-grpc-ingress branch from ab71636 to 03c6687 Compare September 2, 2026 18:27
@jviau
Jacob Viau (jviau) force-pushed the u/jviau/extension-grpc-ingress branch 2 times, most recently from f9ad47b to 15b1601 Compare September 3, 2026 15:53
@jviau
Jacob Viau (jviau) requested a lite review from Copilot September 4, 2026 22:38

Copilot AI 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.

🟡 Changes recommended

The new ingress response pump does not handle host-side Cancel messages and contains an uncaught overflow path that can fail requests without a proper gRPC status.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread src/Functions.WorkerProxy/ExtensionGrpcIngress.cs
Comment thread src/Functions.WorkerProxy/ExtensionGrpcIngress.cs

Copilot AI 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.

🔵 Needs a closer look

The ingress currently accepts malformed grpc-timeout headers without failing the request, and per-call Information-level logs are likely too noisy under load.

Review details

Suppressed comments (3)

Previously missed (2) — in code that hasn't changed since the last review.

src/Functions.WorkerProxy/ExtensionGrpcIngress.cs:260

  • If the request includes a grpc-timeout header but it’s malformed, CreateStart currently ignores it (leaving start.Timeout unset) and continues relaying the request. This can result in inconsistent behavior (no local deadline enforcement) and potentially forwards an invalid timeout value to the host side via metadata. Consider treating an invalid grpc-timeout header as a request formatting error (InvalidArgument) by throwing a FormatException when parsing fails.
    src/Functions.WorkerProxy/ExtensionGrpcIngress.cs:746
  • These per-extension-call logs are currently emitted at Information level, which can be very high volume for gRPC traffic and increase log ingestion costs/noise. In the existing WorkerProxy relay, comparable lifecycle logs are Debug (e.g., FunctionRpcRelay.Session.cs uses Debug for session termination), so consider making this Debug as well (and similarly for the CallCompleted log).

This issue also appears on line 757 of the same file.

src/Functions.WorkerProxy/ExtensionGrpcIngress.cs:757

  • This per-extension-call completion log is emitted at Information level and may be too chatty under load. Consider lowering to Debug to match existing WorkerProxy relay logging patterns and to avoid high-volume info logs.
            LogLevel.Information,
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@jviau
Jacob Viau (jviau) force-pushed the u/jviau/extension-grpc-ingress branch from f43b137 to f604d9a Compare September 5, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compute-separation Compute separation / external worker support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants