300
}
301
303
task.finish(taskFinishResult{})
305
>
// This should only be due to persistence problems. Retry in a new goroutine
306
>
// to not block other tasks, up to some concurrency limit.
307
>
if tr.addRetries.Acquire(tr.backlogMgr.tqCtx, 1) != nil {
308
>
return
309
>
}
310
go tr.retryAddAfterError(task)
311
}
312
}
313
314
>
func (tr *priTaskReader) addErrorBehavior(err error) (drop, retry bool) {
pri_task_reader.go
315
>
// addSpooledTask can only fail due to:
316
>
// - the task queue is closed (errTaskQueueClosed or context.Canceled)
317
>
// - ValidateDeployment failed (InvalidArgument)
318
>
// - versioning wants to get a versioned queue and it can't be initialized
319
>
// - versioning wants to re-spool the task on a different queue and that failed
320
>
// - versioning says StickyWorkerUnavailable
321
>
if errors.Is(err, errTaskQueueClosed) || common.IsContextCanceledErr(err) {
322
>
// maybe we tried to add a task to a versioned queue as it was unloading, and have to
323
>
// retry here. if tqCtx is closing, addTaskToMatcher will give up.
324
>
return false, true
325
>
}
326
var stickyUnavailable *serviceerrors.StickyWorkerUnavailable
327
if errors.As(err, &stickyUnavailable) {