Skip to content

Commit df43b4a

Browse files
authored
fix(bigtable): Retry RST stream errors (#11477)
1 parent fdc626b commit df43b4a

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

bigtable/bigtable.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ var (
193193
}
194194
retryableInternalErrMsgs = []string{
195195
"stream terminated by RST_STREAM", // Retry similar to spanner client. Special case due to https://github.com/googleapis/google-cloud-go/issues/6476
196+
197+
// Special cases due to: https://github.com/googleapis/google-cloud-go/issues/10207#issuecomment-2307562026
198+
"Received Rst stream",
199+
"RST_STREAM closed stream",
200+
"Received RST_STREAM",
196201
}
197202

198203
executeQueryRetryOptions = []gax.CallOption{

bigtable/retry_test.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,20 @@ func TestRetryApply(t *testing.T) {
124124
t.Errorf("conditionally mutating row with no retries: no error")
125125
}
126126

127-
errCount = 0
128-
code = codes.Internal // Will be retried
129-
errMsg = "stream terminated by RST_STREAM"
130-
if err := tbl.Apply(ctx, "row", mut); err != nil {
131-
t.Errorf("applying single mutation with retries: %v", err)
132-
}
133-
row, err = tbl.ReadRow(ctx, "row")
134-
if err != nil {
135-
t.Errorf("reading single value with retries: %v", err)
136-
}
137-
if row == nil {
138-
t.Errorf("applying single mutation with retries: could not read back row")
127+
for _, msg := range retryableInternalErrMsgs {
128+
errCount = 0
129+
code = codes.Internal // Will be retried
130+
errMsg = msg
131+
if err := tbl.Apply(ctx, "row", mut); err != nil {
132+
t.Errorf("applying single mutation with retries: %v, errMsg: %v", err, errMsg)
133+
}
134+
row, err = tbl.ReadRow(ctx, "row")
135+
if err != nil {
136+
t.Errorf("reading single value with retries: %v, errMsg: %v", err, errMsg)
137+
}
138+
if row == nil {
139+
t.Errorf("applying single mutation with retries: could not read back row. errMsg: %v", errMsg)
140+
}
139141
}
140142

141143
errCount = 0

0 commit comments

Comments
 (0)