From 07bc00b2a394d8958d2ff4f090c6e9d2d3279504 Mon Sep 17 00:00:00 2001 From: Jarvan <60028085+jarvanstack@users.noreply.github.com> Date: Sun, 20 Oct 2024 21:05:10 +0800 Subject: [PATCH] fix: A lot of unexpected EOF error when reading from partition --- conn.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conn.go b/conn.go index 2b51afbd5..faa2fb549 100644 --- a/conn.go +++ b/conn.go @@ -858,7 +858,7 @@ func (c *Conn) ReadBatchWith(cfg ReadBatchConfig) *Batch { var msgs *messageSetReader if err == nil { - if highWaterMark == offset { + if highWaterMark == offset || remain == 0 { msgs = &messageSetReader{empty: true} } else { msgs, err = newMessageSetReader(&c.rbuf, remain)