From 8ba4183acd75ed4f3e79342a20bf2a8745a9efcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Tue, 31 Mar 2026 15:50:03 +0200 Subject: [PATCH] [client] Fix error handling in Receive to properly re-establish stream and improve reconnection messaging --- flow/client/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flow/client/client.go b/flow/client/client.go index 9e9403685..d74e4fd47 100644 --- a/flow/client/client.go +++ b/flow/client/client.go @@ -108,7 +108,7 @@ func (c *GRPCClient) Send(event *proto.FlowEvent) error { func (c *GRPCClient) Receive(ctx context.Context, interval time.Duration, msgHandler func(msg *proto.FlowEventAck) error) error { backOff := defaultBackoff(ctx, interval) operation := func() error { - if err := c.establishStreamAndReceive(ctx, msgHandler); err != nil { + if err := c.establishStreamAndReceive(ctx, msgHandler); err == nil { if errors.Is(err, context.Canceled) { return backoff.Permanent(err) } @@ -124,7 +124,7 @@ func (c *GRPCClient) Receive(ctx context.Context, interval time.Duration, msgHan return err } log.Infof("connection recreated successfully") - return nil + return fmt.Errorf("connection recreated, re-establishing stream") } }