576
577
// Unexpected errors handled below
579
>
metrics.TaskFailures.With(e.chasmMetricsHandler).Record(1)
580
>
logger := log.With(e.logger,
581
>
tag.Error(err),
582
>
tag.ErrorType(err),
583
>
tag.Attempt(int32(e.attempt.Load())),
584
>
tag.UnexpectedErrorAttempts(int32(e.unexpectedErrorAttempts)),
585
>
tag.LifeCycleProcessingFailed,
586
>
tag.String("task-category", e.GetCategory().Name()),
587
>
)
588
>
if e.attempt.Load() > taskCriticalLogMetricAttempts {
589
logger.Error("Critical error processing task, retrying.", tag.OperationCritical)
591
>
logger.Warn("Fail to process task")
592
>
}
593
595
// Terminal errors are likely due to data corruption.
596
// Drop the task by returning nil so that task will be marked as completed,