-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tasks with none_failed
trigger rule do not run when all upstream tasks are skipped
#14319
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
As it turns out, this has been fixed between 1.10.12 and HEAD, but has not been released yet. The issue was in https://github.com/apache/airflow/blob/1.10.12/airflow/sensors/base_sensor_operator.py#L112-L114:
Any sensor that inherited BaseSensorOperator and had
This appears to have been fixed in HEAD, where in https://github.com/apache/airflow/blob/master/airflow/sensors/base.py#L233-L236 just the exception is raised and the And as a side note, if you look at https://github.com/apache/airflow/blob/master/airflow/models/taskinstance.py#L1142-L1157, the
I suspect that there should be a |
hi @n-oden this issue is reported against 1.10 |
Same behavior through to |
I can confirm this is fixed in Airflow 2.1.0 and Airflow 2.2.0. DAG code from datetime import datetime
from airflow import DAG
from airflow.decorators import task
from airflow.exceptions import AirflowSkipException
from airflow.operators.dummy import DummyOperator
from airflow.utils.trigger_rule import TriggerRule
@task
def task1():
raise AirflowSkipException
@task
def task2():
raise AirflowSkipException
@task
def task3():
raise AirflowSkipException
with DAG(
dag_id="__test__",
start_date=datetime(2021, 1, 1),
schedule_interval="0 * * * *",
tags=["test"],
catchup=False,
) as dag:
end = DummyOperator(task_id="end", trigger_rule=TriggerRule.NONE_FAILED)
task1() >> task2() >> end
task3() >> end |
Apache Airflow version: 1.10.12
Kubernetes version (if you are using kubernetes) (use
kubectl version
): v1.16.15-gke.6000Environment:
uname -a
):Linux gke-services-1-default-pool-3ef08c09-v95l 4.19.112+ #1 SMP Sat Oct 10 13:45:37 PDT 2020 x86_64 Intel(R) Xeon(R) CPU @ 2.30GHz GenuineIntel GNU/Linux
airflow-7.16.0
What happened:
Even after #7464, we are finding that tasks with the
none_failed
trigger are still being skipped when their direct upstream is skipped.In a simple three-task DAG where, the first step is the GoogleCloudStoragePrefixSensor, followed by a processing task and ending with a heartbeat check operator:
The passive_check task is configured with NONE_FAILED:
The GCS sensor operator exits thusly if it finds no keys:
The intermediate step is also skipped as is intended (it uses the default trigger rule). But the final step is skipped as well, which should not happen:
The same thing happens if we put a dummy shared start task upstream:
What you expected to happen:
The "passive_check" task should have run, because its trigger is
none_failed
and no tasks upstream of it have failed, they have only been skipped.As this was allegedly fixed in #7464, I suspect that either something has regressed since 1.10.10 or there is a corner case not yet caught.
How to reproduce it:
The following DAG reproduces the issue (presuming that you have a working Google Cloud Platform connection and a GCS bucket which the DAG can read):
The text was updated successfully, but these errors were encountered: