Google Cloud Storage go 客户端中的重试逻辑在哪里?

Where is the retrying logic in the Google Cloud Storage go client?

一些 Google documentation 的云存储 go 客户端说:

This library supports reading and writing large amounts of data to Cloud Storage, with internal error handling and retries, so you don't have to write your own code to do this.

但是,当使用以下将对象放入云存储的代码片段时,我偶尔会返回 503 服务不可用错误。

重试云存储请求的逻辑位于何处?

    conf, err := google.JWTConfigFromJSON([]byte(apiKey),storage.ScopeFullControl)

    if err != nil {
        panic(err)
    }

    ctx := cloud.NewContext(projectId, conf.Client(oauth2.NoContext))

    writer := storage.NewWriter(self.ctx, Bucket, key)

    _, err := writer.Write(data)
    if err != nil {
        return err
    }

正如 Glenn Lewis 在 GCloud issue(2 月 20 日)上提到的那样:

We are working on a ResumableMedia upload in the google-api-go-client library that will simply retry from where it left off in case something failed during transfer. I'm hoping that this should solve the problem, but I don't have a date for you as to when this will be ready because there are continuing design discussions.

目前源代码中没有对 ResumableMedia 的引用,因此文档似乎有误。请注意,storage 包是实验性的。