Skip to content

Commit

Permalink
return the first error
Browse files Browse the repository at this point in the history
  • Loading branch information
tangenta committed Dec 13, 2022
1 parent 5050ebf commit 8aa0c7f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ddl/ingest/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,19 @@ func (ei *engineInfo) newWriterContext(workerID int) (*WriterContext, error) {
}

func (ei *engineInfo) closeWriters() error {
var err error
var firstErr error
for wid := range ei.writerCache.Keys() {
if w, ok := ei.writerCache.Load(wid); ok {
_, err = w.Close(ei.ctx)
_, err := w.Close(ei.ctx)
if err != nil {
if firstErr == nil {
firstErr = err
}
}
}
ei.writerCache.Delete(wid)
}
return err
return firstErr
}

// WriteRow Write one row into local writer buffer.
Expand Down

0 comments on commit 8aa0c7f

Please sign in to comment.