| Index: server/logdog/storage/bigtable/bigtable.go
|
| diff --git a/server/logdog/storage/bigtable/bigtable.go b/server/logdog/storage/bigtable/bigtable.go
|
| index 7ac745be25ad4873cbf1c54bdf694dd3eddea4ea..c531475827c49eeaa88a93df2b1a134e2920de7f 100644
|
| --- a/server/logdog/storage/bigtable/bigtable.go
|
| +++ b/server/logdog/storage/bigtable/bigtable.go
|
| @@ -8,7 +8,6 @@ import (
|
| "fmt"
|
| "time"
|
|
|
| - "github.com/luci/luci-go/common/errors"
|
| "github.com/luci/luci-go/common/grpcutil"
|
| "github.com/luci/luci-go/server/logdog/storage"
|
| "golang.org/x/net/context"
|
| @@ -76,7 +75,7 @@ func (t *btTableProd) putLogData(c context.Context, rk *rowKey, data []byte) err
|
|
|
| rowExists := false
|
| if err := t.logTable.Apply(c, rk.encode(), cm, bigtable.GetCondMutationResult(&rowExists)); err != nil {
|
| - return wrapTransient(err)
|
| + return grpcutil.WrapIfTransient(err)
|
| }
|
| if rowExists {
|
| return storage.ErrExists
|
| @@ -122,10 +121,13 @@ func (t *btTableProd) getLogData(c context.Context, rk *rowKey, limit int, keysO
|
| }
|
| return true
|
| }, ropts...)
|
| - if err == nil {
|
| - err = innerErr
|
| + if err != nil {
|
| + return grpcutil.WrapIfTransient(err)
|
| }
|
| - return wrapTransient(err)
|
| + if innerErr != nil {
|
| + return innerErr
|
| + }
|
| + return nil
|
| }
|
|
|
| func (t *btTableProd) setMaxLogAge(c context.Context, d time.Duration) error {
|
| @@ -134,28 +136,11 @@ func (t *btTableProd) setMaxLogAge(c context.Context, d time.Duration) error {
|
| logGCPolicy = bigtable.MaxAgePolicy(d)
|
| }
|
| if err := t.adminClient.SetGCPolicy(c, t.LogTable, logColumnFamily, logGCPolicy); err != nil {
|
| - return wrapTransient(err)
|
| + return grpcutil.WrapIfTransient(err)
|
| }
|
| return nil
|
| }
|
|
|
| -// wrapTransient wraps the supplied error in an errors.TransientError if it is
|
| -// transient.
|
| -func wrapTransient(err error) error {
|
| - if isTransient(err) {
|
| - err = errors.WrapTransient(err)
|
| - }
|
| - return err
|
| -}
|
| -
|
| -// isTransient tests if a BigTable SDK error is transient.
|
| -//
|
| -// Since the BigTable API doesn't give us this information, we will identify
|
| -// transient errors by parsing their error string :(
|
| -func isTransient(err error) bool {
|
| - return (err != errStop) && grpcutil.IsTransient(err)
|
| -}
|
| -
|
| // getLogRowData loads the []byte contents of the supplied log row.
|
| //
|
| // If the row doesn't exist, storage.ErrDoesNotExist will be returned.
|
|
|