diff --git a/record_batch.go b/record_batch.go index 3c148be58..a8c533b17 100644 --- a/record_batch.go +++ b/record_batch.go @@ -161,6 +161,11 @@ func (b *RecordBatch) decode(pd packetDecoder) (err error) { bufSize := int(batchLen) - recordBatchOverhead recBuffer, err := pd.getRawBytes(bufSize) if err != nil { + if err == ErrInsufficientData { + b.PartialTrailingRecord = true + b.Records = nil + return nil + } return err }