-
Notifications
You must be signed in to change notification settings - Fork 279
Description
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
- Listen to a server --> client stream
- Wait the
ChannelOptions.connectionTimeout
amount of time - Make a new / different gRPC call
- The server detects the previously-active stream as 'cancelled'
- 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.