232
task := itask.event.AllocatedTaskInfo
233
if err != nil {
235
>
// We cannot just remove it from persistence because then it will be lost.
236
>
// We handle this by writing the task back to persistence with a higher taskID.
237
>
// This will allow subsequent tasks to make progress, and hopefully by the time this task is picked-up
238
>
// again the underlying reason for failing to start will be resolved.
239
>
metrics.TaskRewrites.With(c.metricsHandler).Record(1)
240
>
err = executeWithRetry(context.Background(), func(_ context.Context) error {
241
>
return c.taskWriter.appendTask(task.Data)
242
>
})
243
245
// OK, we also failed to write to persistence.
246
// This should only happen in very extreme cases where persistence is completely down.