return error in Batch.doImport if there is one

swallowing this error was a mistake... caller would not know that
ingest failed and might incorrectly report success
upstream (e.g. committing offsets to Kafka)
This commit is contained in:
Matthew Jaffee 2022-05-19 15:47:25 -05:00 committed by Matthew Jaffee
parent dc20f8c689
commit 62971f55dd

View file

@ -700,9 +700,7 @@ func (b *Batch) Import() error {
// import int data.
err = b.doImport(frags, clearFrags)
if err != nil {
// doImport actually imports the ingested data. An error here, means an error with the value that is trying to be ingested.
// We log the error, so we can continue ingesting. Returning would stop the ingest.
b.log.Printf("error importing batch: %v", err)
return errors.Wrap(err, "doing import")
}
b.log.Printf("importing fragments took %v", time.Since(makeTime))
}