Skip to content

Commit

Permalink
fix(bigquery): improve retry for table create (#5807)
Browse files Browse the repository at this point in the history
Wraps table creation in the standard retryer.

Fixes: #5805
  • Loading branch information
shollyman authored Mar 28, 2022
1 parent 21a3cce commit f27d1dc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bigquery/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,13 @@ func (t *Table) Create(ctx context.Context, tm *TableMetadata) (err error) {
DatasetId: t.DatasetID,
TableId: t.TableID,
}

req := t.c.bqs.Tables.Insert(t.ProjectID, t.DatasetID, table).Context(ctx)
setClientHeader(req.Header())
_, err = req.Do()
return err
return runWithRetry(ctx, func() (err error) {
_, err = req.Do()
return err
})
}

func (tm *TableMetadata) toBQ() (*bq.Table, error) {
Expand Down

0 comments on commit f27d1dc

Please sign in to comment.