shivaam commented on code in PR #63035:
URL: https://github.com/apache/airflow/pull/63035#discussion_r2937496249
##########
providers/amazon/src/airflow/providers/amazon/aws/executors/aws_lambda/lambda_executor.py:
##########
@@ -313,59 +377,59 @@ def attempt_task_runs(self):
failure_reasons.append(str(e))
if failure_reasons:
- # Make sure the number of attempts does not exceed max invoke
attempts
+ # Make sure the number of attempts does not exceed max invoke
attempts.
if int(attempt_number) < int(self.max_invoke_attempts):
- task_to_run.attempt_number += 1
- task_to_run.next_attempt_time = timezone.utcnow() +
calculate_next_attempt_delay(
+ workload_to_run.attempt_number += 1
+ workload_to_run.next_attempt_time = timezone.utcnow() +
calculate_next_attempt_delay(
attempt_number
)
- self.pending_tasks.append(task_to_run)
+ self.pending_workloads.append(workload_to_run)
else:
reasons_str = ", ".join(failure_reasons)
self.log.error(
"Lambda invoke %s has failed a maximum of %s times.
Marking as failed. Reasons: %s",
- task_key,
+ workload_key,
attempt_number,
reasons_str,
)
self.log_task_event(
event="lambda invoke failure",
- ti_key=task_key,
+ ti_key=workload_key,
Review Comment:
When a callback workload exceeds max submit attempts, log_task_event is
called with ti_key=workload_key. For callbacks, this key is a string UUID, not
a TaskInstanceKey named tuple, which will cause errors since
Log(task_instance=...) expects a TaskInstanceKey. Is this a problem @ferruzzi ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]