Skip to content

Add support for gRPC response trailers in EPP#2510

Merged
k8s-ci-robot merged 2 commits into
kubernetes-sigs:mainfrom
zetxqx:pregrpc
Mar 10, 2026
Merged

Add support for gRPC response trailers in EPP#2510
k8s-ci-robot merged 2 commits into
kubernetes-sigs:mainfrom
zetxqx:pregrpc

Conversation

@zetxqx

@zetxqx zetxqx commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

What this PR does / why we need it:

This PR adds ResponseTrailers handling to the EPP ExtProc server to properly support gRPC requests. gRPC over HTTP/2 relies on response trailers to signal the end of a response, rather than just EndOfStream on the response body.

for gRPC over HTTP2 resposne endOfStream see: Ref

Which issue(s) this PR fixes:

pre-req for #2166

Does this PR introduce a user-facing change?:


@netlify

netlify Bot commented Mar 6, 2026

Copy link
Copy Markdown

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit 4704366
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/69b07d0f58128e00070013c2
😎 Deploy Preview https://deploy-preview-2510--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot
k8s-ci-robot requested review from ahg-g and shmuelk March 6, 2026 23:32
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 6, 2026
}

func (s *StreamingServer) finishResponse(ctx context.Context, reqCtx *RequestContext, body []byte) error {
if reqCtx.ResponseComplete {

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.

add a comment pls on what this means, iiuc it means we already completed the response and so we don't want to execute finishResponse again, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, added a comment in 4704366

Comment thread pkg/epp/handlers/server.go Outdated
Comment thread pkg/epp/handlers/server.go Outdated
}
case *extProcPb.ProcessingRequest_ResponseTrailers:
// This is currently unused.
// For HTTP, the response trailer is not sent. Thus, it won't achieve this case.

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.

even if it was sent in the http case and this logic gets executed, we should be ok, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, because we only set reqCtx.ResponseComplete to true in the new finishResponse. and the first early return check for finishResponse makes it idempotent in the whole request lifecycle

image

@ahg-g

ahg-g commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 10, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, zetxqx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 10, 2026
@zetxqx

zetxqx commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

This line fails in integration tests:

// Wait for TCP readiness.
// We must poll the port until the server successfully binds and listens.
require.Eventually(t, func() bool {

image

/retest

@ahg-g

ahg-g commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

can we increase the timeout to 10s pls?

@k8s-ci-robot
k8s-ci-robot merged commit 9073b44 into kubernetes-sigs:main Mar 10, 2026
11 checks passed
@zetxqx

zetxqx commented Mar 11, 2026

Copy link
Copy Markdown
Contributor Author

can we increase the timeout to 10s pls?

@ahg-g Created a PR here #2547

BizerNotNull pushed a commit to BizerNotNull/gateway-api-inference-extension that referenced this pull request Mar 15, 2026
* processing respTrailers for gRPC request

* polish comments
elevran pushed a commit to llm-d/llm-d-router that referenced this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants