365
}
366
367
>
func (c *fairBacklogManagerImpl) respoolTaskAfterError(task *persistencespb.TaskInfo) error {
fair_backlog_manager.go
368
>
// We cannot just remove it from persistence because then it will be lost.
369
>
// We handle this by writing the task back to persistence with a higher taskID.
370
>
// This will allow subsequent tasks to make progress, and hopefully by the time this task is picked-up
371
>
// again the underlying reason for failing to start will be resolved.
372
>
// Note the task may get written to a different subqueue than it came from.
373
>
metrics.TaskRewrites.With(c.metricsHandler).Record(1)
374
>
err := backoff.ThrottleRetryContext(c.tqCtx, func(context.Context) error {
375
>
return c.SpoolTask(task)
376
>
}, persistenceOperationRetryPolicy, common.IsPersistenceTransientError)
377
>
if err == nil {
378
>
return nil
379
>
}
380
381
// OK, we also failed to write to persistence.