mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-04 11:45:09 -04:00
[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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user