[client] remove WaitForReady from stream open call

grpc.WaitForReady(true) parks the RPC call internally until the
connection reaches READY, only unblocking on ctx cancellation.
This means the external backoff.Retry loop in Receive() never gets
control back during a connection outage — it cannot tick, log, or
apply its retry intervals while WaitForReady is blocking.

Removing it restores fail-fast behaviour: Events() returns immediately
with codes.Unavailable when the connection is not ready, which is
exactly what the backoff loop expects. The backoff becomes the single
authority over retry timing and cadence, as originally intended.
This commit is contained in:
Zoltán Papp
2026-03-31 14:56:01 +02:00
parent 13dfc5fcdd
commit fae50520ff

View File

@@ -127,7 +127,7 @@ func (c *GRPCClient) Receive(ctx context.Context, interval time.Duration, msgHan
}
func (c *GRPCClient) establishStreamAndReceive(ctx context.Context, msgHandler func(msg *proto.FlowEventAck) error) error {
stream, err := c.realClient.Events(ctx, grpc.WaitForReady(true))
stream, err := c.realClient.Events(ctx)
if err != nil {
return fmt.Errorf("create event stream: %w", err)
}