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

Unified Diff: logdog/server/cmd/logdog_collector/main.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
Index: logdog/server/cmd/logdog_collector/main.go
diff --git a/logdog/server/cmd/logdog_collector/main.go b/logdog/server/cmd/logdog_collector/main.go
index 078a9de979c742dc35bd487bb7bfa4042f657f2e..10168efca113d0bc2953c516f52f03ded19f758e 100644
--- a/logdog/server/cmd/logdog_collector/main.go
+++ b/logdog/server/cmd/logdog_collector/main.go
@@ -15,6 +15,7 @@ import (
log "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/proto/google"
"github.com/luci/luci-go/common/retry"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/common/tsmon/distribution"
"github.com/luci/luci-go/common/tsmon/field"
"github.com/luci/luci-go/common/tsmon/metric"
@@ -150,7 +151,7 @@ func (a *application) runCollector(c context.Context) error {
}
}
- err = retry.Retry(c, retry.TransientOnly(retryForever), func() error {
+ err = retry.Retry(c, transient.Only(retryForever), func() error {
return grpcutil.WrapIfTransient(psSub.Receive(c, func(c context.Context, msg *pubsub.Message) {
c = log.SetField(c, "messageID", msg.ID)
if a.processMessage(c, &coll, msg) {
@@ -191,7 +192,7 @@ func (a *application) processMessage(c context.Context, coll *collector.Collecto
tsTaskProcessingTime.Add(c, duration.Seconds()*1000)
switch {
- case errors.IsTransient(err):
+ case transient.Tag.In(err):
// Do not consume
log.Fields{
log.ErrorKey: err,

Powered by Google App Engine
This is Rietveld 408576698