Skip to content

Commit

Permalink
Merge pull request #998 from wladh/master
Browse files Browse the repository at this point in the history
Check for insufficient data when we try to get the records.
  • Loading branch information
eapache authored Dec 5, 2017
2 parents 703eaab + eee4c71 commit 8f05b2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions record_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 8f05b2f

Please sign in to comment.