Skip to content

Commit f290086

Browse files
committed
Disable start_from_trigger altogether for now
1 parent 845f775 commit f290086

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

airflow-core/src/airflow/models/dagrun.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,18 +2004,23 @@ def schedule_tis(
20042004
and not task.inlets
20052005
):
20062006
empty_ti_ids.append(ti.id)
2007-
# check "start_trigger_args" to see whether the operator supports start execution from triggerer
2008-
# if so, we'll then check "start_from_trigger" to see whether this feature is turned on and defer
2009-
# this task.
2010-
# if not, we'll add this "ti" into "schedulable_ti_ids" and later execute it to run in the worker
2011-
elif task.start_trigger_args is not None:
2012-
if task.expand_start_from_trigger(context=ti.get_template_context()):
2013-
ti.start_date = timezone.utcnow()
2014-
if ti.state != TaskInstanceState.UP_FOR_RESCHEDULE:
2015-
ti.try_number += 1
2016-
ti.defer_task(exception=None, session=session)
2017-
else:
2018-
schedulable_ti_ids.append(ti.id)
2007+
# Check "start_trigger_args" to see whether the operator supports
2008+
# start execution from triggerer. If so, we'll check "start_from_trigger"
2009+
# to see whether this feature is turned on and defer this task.
2010+
# If not, we'll add this "ti" into "schedulable_ti_ids" and later
2011+
# execute it to run in the worker.
2012+
# TODO TaskSDK: This is disabled since we haven't figured out how
2013+
# to render start_from_trigger in the scheduler. If we need to
2014+
# render the value in a worker, it kind of defeats the purpose of
2015+
# this feature (which is to save a worker process if possible).
2016+
# elif task.start_trigger_args is not None:
2017+
# if task.expand_start_from_trigger(context=ti.get_template_context()):
2018+
# ti.start_date = timezone.utcnow()
2019+
# if ti.state != TaskInstanceState.UP_FOR_RESCHEDULE:
2020+
# ti.try_number += 1
2021+
# ti.defer_task(exception=None, session=session)
2022+
# else:
2023+
# schedulable_ti_ids.append(ti.id)
20192024
else:
20202025
schedulable_ti_ids.append(ti.id)
20212026

0 commit comments

Comments
 (0)