From 561a4b79212a0596bad13acebfa94f9f2bc39bbf Mon Sep 17 00:00:00 2001 From: Valentin Staykov Date: Fri, 11 Oct 2024 09:26:18 +0000 Subject: [PATCH] fix: send stop command after normal stop of reading --- zk/datastream/client/stream_client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zk/datastream/client/stream_client.go b/zk/datastream/client/stream_client.go index fa52fdd07a1..183a0832b8a 100644 --- a/zk/datastream/client/stream_client.go +++ b/zk/datastream/client/stream_client.go @@ -551,6 +551,9 @@ LOOP: if c.header.TotalEntries == entryNum+1 { log.Trace("reached the end of the stream", "header_totalEntries", c.header.TotalEntries, "entryNum", entryNum) + if err = c.sendStopCmd(); err != nil { + return fmt.Errorf("failed to send the stop command: %v", err) + } break LOOP } }