Skip to content

BUG: GRPCResponseHeadersFilter forces grpc-status in trailer to 0 #3783

@KimTaehee

Description

@KimTaehee

version: 4.2.1~4.3.0-M3

There is a bug where GRPCResponseHeadersFilter forces the grpc-status in the trailer to 0.

Assuming that when using gRPC to call a server streaming RPC, the downstream server successfully responds with 2 messages and then encounters an error, responding with a status of 10 (Aborted). The frame that the downstream server responses to the gateway would look like this:

HEADERS FRAME
:status = 200 OK
trailer: grpc-status,grpc-message
content-type = application/grpc
grpc-encoding = identity
grpc-accept-encoding = grpc

DATA FRAME 1
(content)

DATA FRAME 2
(content)

HEADERS FRAME (End stream, =trailer)
grpc-status = 10

However, in the HttpServerOperations#onOutboundComplete() method, the trailerHeaders consumer injected by the GRPCResponseHeadersFilter sets the grpc-status to 0 because the first HEADERS FRAME does not contain a grpc-status value. This seems to be incorrect behavior. Am I misunderstanding something? If it is a bug, what should be done?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions