Skip to content

call reports empty response payload even if the call ended with an OK status #23559

@yashykt

Description

@yashykt

Internal bug tracking - b/160009494 (found by @sheenaqotj)

The issue is that if the call deadline fires, it is possible for the transport to drop the incoming messages even if it has received an OK status. This happens in the case that the transport has received the status, closed reads and writes, but it hasn't yet invoked the callback for receiving trailing metadata.

A more detailed explanation of the steps to reach to this point -

  1. Client starts a call with a deadline.
  2. The transport receives the OK status and is both read and write closed.
  3. The recv_trailing_metadata callback has not been called. (One possible reason for the callback not having been called yet is that there is still pending data to be reported)
  4. The deadline fires.
  5. gRPC currently cancels the stream but does not fake the status since the status has already been received and the stream is both read and write closed.

To fix this, we could either -

  1. Not cancel the stream if it is both read and write closed already.
  2. Fake the status and the trailing metadata effectively overwriting the existing trailing metadata, so that if the messages are dropped due to cancellation, we also update the status.

I think 1) is the right fix to this

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions