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