feat(worker-proxy): proxy extension gRPC calls - #11961
feat(worker-proxy): proxy extension gRPC calls#11961Jacob Viau (jviau) wants to merge 5 commits into
Conversation
14e7bdb to
5d297e8
Compare
There was a problem hiding this comment.
🟡 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
ExtensionGrpcIngressto translate HTTP/gRPC framing + metadata intoExtensionRpcMessagestart/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.
5d297e8 to
ab71636
Compare
ab71636 to
03c6687
Compare
f9ad47b to
15b1601
Compare
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🔵 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-timeoutheader but it’s malformed,CreateStartcurrently ignores it (leavingstart.Timeoutunset) 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 invalidgrpc-timeoutheader as a request formatting error (InvalidArgument) by throwing aFormatExceptionwhen 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
f43b137 to
f604d9a
Compare
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-procbranch to be included in Core Tools and non-Flex deployments.in-procbranch is not requiredrelease_notes.mdAdditional 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.