Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3037)

Unified Diff: appengine/datastorecache/cache.go

Issue 2951393002: [errors] de-specialize Transient in favor of Tags. (Closed)
Patch Set: more refactor Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/gaeauth/client/client.go » ('j') | common/errors/tags.go » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/datastorecache/cache.go
diff --git a/appengine/datastorecache/cache.go b/appengine/datastorecache/cache.go
index 3b5d38f2f30060030875b3f806a79051d4a2250f..4c8fa1fe7c1217f254ee5cf4d2729408ceafba5c 100644
--- a/appengine/datastorecache/cache.go
+++ b/appengine/datastorecache/cache.go
@@ -13,6 +13,7 @@ import (
"github.com/luci/luci-go/common/errors"
log "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/retry"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/server/router"
"github.com/luci/gae/impl/prod/constraints"
@@ -296,7 +297,7 @@ func (bci *boundCacheInst) get(c context.Context, key []byte) (Value, error) {
delta time.Duration
)
err := retry.Retry(clock.Tag(c, "datastoreCacheLockRetry"),
- retry.TransientOnly(bci.refreshRetryFactory), func() error {
+ transient.Only(bci.refreshRetryFactory), func() error {
// This is a retry. If the entry was missing before, check to see if some
// other process has since added it to the datastore.
@@ -336,7 +337,7 @@ func (bci *boundCacheInst) get(c context.Context, key []byte) (Value, error) {
case ErrFailedToLock:
// Retry after delay.
- return errors.WrapTransient(err)
+ return transient.Tag.Apply(err)
default:
log.WithError(err).Warningf(c, "Unexpected failure obtaining initial load lock.")
« no previous file with comments | « no previous file | appengine/gaeauth/client/client.go » ('j') | common/errors/tags.go » ('J')

Powered by Google App Engine
This is Rietveld 408576698