Skip to content

Bug: Active Streams Silently Killed after connectionTimeout #752

@lapumb

Description

@lapumb

Any active stream(s) are silently killed without notifying the listeners once the first gRPC call is made after the ClientChannel's connectionTimeout is reached.

This feels like a bug to me.

gRPC Package Version Info:

  grpc:
    dependency: "direct main"
    description:
      name: grpc
      sha256: "5b99b7a420937d4361ece68b798c9af8e04b5bc128a7859f2a4be87427694813"
      url: "https://pub.dev"
    source: hosted
    version: "4.0.1"

Platform: Linux

Repro steps

  1. Listen to a server --> client stream
  2. Wait the ChannelOptions.connectionTimeout amount of time
  3. Make a new / different gRPC call
  4. The server detects the previously-active stream as 'cancelled'
  5. The client continues to listen to the previously-active stream and never gets notified of cancellation (onDone)

Run the examples in https://github.com/lapumb/grpc-stream-example to easily reproduce.

Expected result: If the server detects a stream cancellation, the client (listener) should be notified via a stream error or the onDone event.

Actual result: The server ends the stream and the client continues to listen indefinitely.

Details

It appears that streams active when the connection timeout occurs will stay in a working / data receiving state until a new gRPC call is made after the connection timeout.

To get around this, I have had to implement heartbeats in my streams so my client can detect if it actually stopped receiving data altogether.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions