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

Unified Diff: scheduler/appengine/task/buildbucket/buildbucket.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: scheduler/appengine/task/buildbucket/buildbucket.go
diff --git a/scheduler/appengine/task/buildbucket/buildbucket.go b/scheduler/appengine/task/buildbucket/buildbucket.go
index 48e7a731fa5d065c045ca9f359c9ca40207f1655..a25727f54f53c4383ea2a1ece66303be601df771 100644
--- a/scheduler/appengine/task/buildbucket/buildbucket.go
+++ b/scheduler/appengine/task/buildbucket/buildbucket.go
@@ -18,6 +18,7 @@ import (
"github.com/luci/gae/service/info"
"github.com/luci/luci-go/common/api/buildbucket/buildbucket/v1"
"github.com/luci/luci-go/common/errors"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/scheduler/appengine/messages"
"github.com/luci/luci-go/scheduler/appengine/task"
"github.com/luci/luci-go/scheduler/appengine/task/utils"
@@ -296,7 +297,7 @@ func (m TaskManager) checkBuildStatus(c context.Context, ctl task.Controller) er
// still running LaunchTask when saving the invocation, it will only make the
// matters worse.
case status == task.StatusStarting:
- return errors.WrapTransient(errors.New("invocation is still starting, try again later"))
+ return errors.New("invocation is still starting, try again later", transient.Tag)
case status != task.StatusRunning:
return fmt.Errorf("unexpected invocation status %q, expecting %q", status, task.StatusRunning)
}
@@ -317,7 +318,7 @@ func (m TaskManager) checkBuildStatus(c context.Context, ctl task.Controller) er
if err != nil {
ctl.DebugLog("Failed to fetch buildbucket build - %s", err)
err = utils.WrapAPIError(err)
- if !errors.IsTransient(err) {
+ if !transient.Tag.In(err) {
ctl.State().Status = task.StatusFailed
}
return err

Powered by Google App Engine
This is Rietveld 408576698