-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gensupport: expand retryable errors (#529)
* gensupport: expand retryable errors This commit improves retry handling by allowing retries for the following: * Wrapped errors that are retryable (Go 1.13+ only) * Transient network errors Following retry guidance from https://cloud.google.com/storage/docs/exponential-backoff Note that this conflicts with #528, but it's an easy conflict for me to fix once one of them is merged. Fixes #449
- Loading branch information
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2020 Google LLC. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
// +build linux | ||
|
||
package gensupport | ||
|
||
import "syscall" | ||
|
||
func init() { | ||
// Initialize syscallRetryable to return true on transient socket-level | ||
// errors. These errors are specific to Linux. | ||
syscallRetryable = func(err error) bool { return err == syscall.ECONNRESET || err == syscall.ECONNREFUSED } | ||
} |