Skip to content

Commit

Permalink
SNOW-976500 Do not drop errors from chunk downloader starting (#994)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pfus authored Dec 19, 2023
1 parent d942efb commit 4b69339
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 6 additions & 1 deletion async.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,17 @@ func (sr *snowflakeRestful) getAsync(
if isMultiStmt(&respd.Data) {
if err = sc.handleMultiQuery(ctx, respd.Data, rows); err != nil {
rows.errChannel <- err
close(rows.errChannel)
return err
}
} else {
rows.addDownloader(populateChunkDownloader(ctx, sc, respd.Data))
}
rows.ChunkDownloader.start()
if err = rows.ChunkDownloader.start(); err != nil {
rows.errChannel <- err
close(rows.errChannel)
return err
}
rows.errChannel <- nil // mark query status complete
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,6 @@ func (sc *snowflakeConn) buildRowsForRunningQuery(
if err := sc.rowsForRunningQuery(ctx, qid, rows); err != nil {
return nil, err
}
rows.ChunkDownloader.start()
return rows, nil
err := rows.ChunkDownloader.start()
return rows, err
}
4 changes: 3 additions & 1 deletion rows.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ func (rows *snowflakeRows) NextResultSet() error {
return io.EOF
}
rows.ChunkDownloader = rows.ChunkDownloader.getNextChunkDownloader()
rows.ChunkDownloader.start()
if err := rows.ChunkDownloader.start(); err != nil {
return err
}
}
return rows.ChunkDownloader.nextResultSet()
}
Expand Down

0 comments on commit 4b69339

Please sign in to comment.