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