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 } }