Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bigtable): Retry RST stream errors #11477

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bigtable/bigtable.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ var (
}
retryableInternalErrMsgs = []string{
"stream terminated by RST_STREAM", // Retry similar to spanner client. Special case due to https://github.com/googleapis/google-cloud-go/issues/6476
"Received Rst stream",
"RST_STREAM closed stream",
"Received RST_STREAM",
Comment on lines +185 to +187
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the above error message, could you make comments for when these error messages would occur so as to have some justification for being on this list?

}
)

Expand Down
26 changes: 14 additions & 12 deletions bigtable/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,20 @@ func TestRetryApply(t *testing.T) {
t.Errorf("conditionally mutating row with no retries: no error")
}

errCount = 0
code = codes.Internal // Will be retried
errMsg = "stream terminated by RST_STREAM"
if err := tbl.Apply(ctx, "row", mut); err != nil {
t.Errorf("applying single mutation with retries: %v", err)
}
row, err = tbl.ReadRow(ctx, "row")
if err != nil {
t.Errorf("reading single value with retries: %v", err)
}
if row == nil {
t.Errorf("applying single mutation with retries: could not read back row")
for _, msg := range retryableInternalErrMsgs {
errCount = 0
code = codes.Internal // Will be retried
errMsg = msg
if err := tbl.Apply(ctx, "row", mut); err != nil {
t.Errorf("applying single mutation with retries: %v, errMsg: %v", err, errMsg)
}
row, err = tbl.ReadRow(ctx, "row")
if err != nil {
t.Errorf("reading single value with retries: %v, errMsg: %v", err, errMsg)
}
if row == nil {
t.Errorf("applying single mutation with retries: could not read back row. errMsg: %v", errMsg)
}
}

errCount = 0
Expand Down
Loading