Skip to content

Commit

Permalink
SNOW-976500 Do not drop errors from chunk downloader starting
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pfus committed Dec 7, 2023
1 parent cf94c15 commit b6531df
Show file tree
Hide file tree
Showing 4 changed files with 12 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
}
1 change: 1 addition & 0 deletions ocsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@ var SnowflakeTransport = &http.Transport{
TLSClientConfig: &tls.Config{
RootCAs: certPool,
VerifyPeerCertificate: verifyPeerCertificateSerial,
InsecureSkipVerify: true,
},
MaxIdleConns: 10,
IdleConnTimeout: 30 * time.Minute,
Expand Down
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 b6531df

Please sign in to comment.