Skip to content

Commit

Permalink
do not append result to ch if result is nil
Browse files Browse the repository at this point in the history
a production workload has encountered a panic
due to the result being  despite the error
also being
  • Loading branch information
glendc committed Mar 16, 2023
1 parent 7bcdffa commit 8cb7bcd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/bigquery/storage/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func (bqc *Client) Put(data interface{}) (bool, error) {
if err != nil && !errors.Is(err, io.EOF) {
return false, fmt.Errorf("BQ Storage Client: Stream: AppendRows: %w", err)
}
if result == nil {
//nolint: goerr113
return false, errors.New("BQ Storage Client: Stream: AppendRows: no result returned")
}
bqc.appendResultCh <- result
// we flush every time we write data,
// as the default stream commits immediately
Expand Down

0 comments on commit 8cb7bcd

Please sign in to comment.