This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new a3fc50d00b Remove obsolete conditional logic related to try_number
(#40104)
a3fc50d00b is described below
commit a3fc50d00b75d65b2a9c9069cc9fbafaa29bdddd
Author: Daniel Standish <[email protected]>
AuthorDate: Fri Jun 7 01:48:58 2024 -0700
Remove obsolete conditional logic related to try_number (#40104)
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.
---
airflow/models/taskinstance.py | 8 --------
1 file changed, 8 deletions(-)
diff --git a/airflow/models/taskinstance.py b/airflow/models/taskinstance.py
index 1637c06e58..087b0f2249 100644
--- a/airflow/models/taskinstance.py
+++ b/airflow/models/taskinstance.py
@@ -3186,14 +3186,6 @@ class TaskInstance(Base, LoggingMixin):
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