Skip to content

Commit

Permalink
fix(pubsub): retry all goaway errors (#4384)
Browse files Browse the repository at this point in the history
The previous iteration of this PR, #4313, only retried GOAWAY in conjunction with an EOF string, which doesn't capture all GOAWAY errors. Now, all error messages with `GOAWAY` and error code `UNKNOWN` are retried.

Fixes #4257
  • Loading branch information
hongalex committed Jul 7, 2021
1 parent 770477c commit 1eae86f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pubsub/service.go
Expand Up @@ -64,8 +64,7 @@ func (r *defaultRetryer) Retry(err error) (pause time.Duration, shouldRetry bool
return 0, false
case codes.Unknown:
// Retry GOAWAY, see https://github.com/googleapis/google-cloud-go/issues/4257.
isGoaway := strings.Contains(s.Message(), "error reading from server: EOF") &&
strings.Contains(s.Message(), "received prior goaway")
isGoaway := strings.Contains(s.Message(), "received prior goaway: code: NO_ERROR")
if isGoaway {
return r.bo.Pause(), true
}
Expand Down

0 comments on commit 1eae86f

Please sign in to comment.