From b204ca6bf7a1dffe15ab98ea0e04f2ead05704e8 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Wed, 1 Jan 2025 16:41:03 +0200 Subject: [PATCH] safer checks for EOF Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/binlog/binlog_streamer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go/vt/binlog/binlog_streamer.go b/go/vt/binlog/binlog_streamer.go index efb308537ac..b737e9b35d1 100644 --- a/go/vt/binlog/binlog_streamer.go +++ b/go/vt/binlog/binlog_streamer.go @@ -35,6 +35,7 @@ import ( "vitess.io/vitess/go/vt/dbconfigs" "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vttablet/tabletserver/schema" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" @@ -279,7 +280,7 @@ func (bls *Streamer) parseEvents(ctx context.Context, events <-chan mysql.Binlog Position: replication.EncodePosition(pos), } if err = bls.sendTransaction(eventToken, statements); err != nil { - if errors.Is(err, io.EOF) { + if errors.Is(vterrors.UnwrapAll(err), io.EOF) { return ErrClientEOF } return fmt.Errorf("send reply error: %v", err)