Skip to content

Commit 2e95291

Browse files
committed
Catch errors creating new iterators in rowReaders
Signed-off-by: Javi Fontan <[email protected]>
1 parent 847f97f commit 2e95291

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

repository_pool.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,18 @@ func (i *rowRepoIter) rowReader(num int) {
276276
defer i.wg.Done()
277277

278278
for repo := range i.repos {
279-
iter, _ := i.iter.NewIterator(repo)
279+
iter, err := i.iter.NewIterator(repo)
280+
if err != nil {
281+
// guard from possible previous error
282+
select {
283+
case <-i.done:
284+
return
285+
default:
286+
i.setError(err)
287+
close(i.done)
288+
continue
289+
}
290+
}
280291

281292
loop:
282293
for {

0 commit comments

Comments
 (0)