Skip to content

Commit

Permalink
Remove obsolete conditional logic related to try_number (apache#40104)
Browse files Browse the repository at this point in the history
We used to increment try_number in a specific scenario re failure / queued but it's obsolete now.  And the pydantic bit of it is obsolete too.
  • Loading branch information
dstandish authored and jannisko committed Jun 15, 2024
1 parent fbfdc5b commit 1ed3c40
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions airflow/models/taskinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3186,14 +3186,6 @@ def fetch_handle_failure_context(
if task and fail_stop:
_stop_remaining_tasks(task_instance=ti, session=session)
else:
if ti.state == TaskInstanceState.QUEUED:
from airflow.serialization.pydantic.taskinstance import TaskInstancePydantic

if isinstance(ti, TaskInstancePydantic):
# todo: (AIP-44) we should probably "coalesce" `ti` to TaskInstance before here
# e.g. we could make refresh_from_db return a TI and replace ti with that
raise RuntimeError("Expected TaskInstance here. Further AIP-44 work required.")
# We increase the try_number to fail the task if it fails to start after sometime
ti.state = State.UP_FOR_RETRY
email_for_state = operator.attrgetter("email_on_retry")
callbacks = task.on_retry_callback if task else None
Expand Down

0 comments on commit 1ed3c40

Please sign in to comment.