157
}
158
160
>
161
>
// We can handle some transient errors by just putting the task back in the matcher to
162
>
// match again. Note that for forwarded tasks, it's expected to get DeadlineExceeded when
163
>
// the task doesn't match on the root after backlogTaskForwardTimeout, and also expected to
164
>
// get errRemoteSyncMatchFailed, which is a serviceerror.Canceled error.
165
>
if common.IsServiceClientTransientError(err) ||
166
>
common.IsContextDeadlineExceededErr(err) ||
167
>
common.IsContextCanceledErr(err) {
168
>
// TODO(pri): if this was a start error (not a forwarding error): consider adding a
169
>
// per-task backoff here, in case the error was workflow busy, we don't want to end up
170
>
// trying the same task immediately. maybe also: after a few attempts on the same task,
171
>
// let it get cycled to the end of the queue, in case there's some task/wf-specific
172
>
// thing.
173
>
tr.addTaskToMatcher(task)
174
>
metrics.TaskRetryTransient.With(tr.backlogMgr.metricsHandler).Record(1)
175
>
return
176
>
}
177
178
// On other errors: ask backlog manager to re-spool to persistence