Skip to content

Commit

Permalink
fix(bigquery): add special http2 case to retry predicate (#3129)
Browse files Browse the repository at this point in the history
This adds a special case to the default retry predicate for
BigQuery to work around a specific high concurrency issue.

Related: #1793
  • Loading branch information
shollyman committed Nov 3, 2020
1 parent e228969 commit b7bc5f8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bigquery/bigquery.go
Expand Up @@ -166,6 +166,14 @@ func runWithRetry(ctx context.Context, call func() error) error {
// retryable; these are returned by systems between the client and the BigQuery
// service.
func retryableError(err error) bool {
// Special case due to http2: https://github.com/googleapis/google-cloud-go/issues/1793
// Due to Go's default being higher for streams-per-connection than is accepted by the
// BQ backend, it's possible to get streams refused immediately after a connection is
// started but before we receive SETTINGS frame from the backend. This generally only
// happens when we try to enqueue > 100 requests onto a newly initiated connection.
if err.Error() == "http2: stream closed" {
return true
}
e, ok := err.(*googleapi.Error)
if !ok {
return false
Expand Down

0 comments on commit b7bc5f8

Please sign in to comment.