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

Unified Diff: scheduler/appengine/task/swarming/swarming.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/swarming/swarming.go
diff --git a/scheduler/appengine/task/swarming/swarming.go b/scheduler/appengine/task/swarming/swarming.go
index 20928c55790c3645d5768e2d97994c94ad8302bb..8fbec30ecc01a9edbd03e454103f30ccb976ea6a 100644
--- a/scheduler/appengine/task/swarming/swarming.go
+++ b/scheduler/appengine/task/swarming/swarming.go
@@ -18,6 +18,7 @@ import (
"github.com/luci/gae/service/info"
"github.com/luci/luci-go/common/api/swarming/swarming/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"
@@ -356,7 +357,7 @@ func (m TaskManager) checkTaskStatus(c context.Context, ctl task.Controller) err
// 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)
}
@@ -377,7 +378,7 @@ func (m TaskManager) checkTaskStatus(c context.Context, ctl task.Controller) err
if err != nil {
ctl.DebugLog("Failed to fetch task results - %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