问题
I am trying to setup and understand custom policy. Not sure what I am doing wrong however, following this is not working.
Airflow Version: 1.10.10
Expected result: it should throw exception if I try to run DAG with default_owner
Actual Result: no such exception
/root/airflow/config/airflow_local_settings.py
class PolicyError(Exception):
pass
def cluster_policy(task):
print("task_instance_mutation_hook")
raise PolicyError
def task_instance_mutation_hook(ti):
print("task_instance_mutation_hook")
raise PolicyError
- /root/airflow/config/airflow_local_settings.pyc file is being created so I know this file is being processed by airflow.
- if there is any compilation error in this file all my dags fails. however not with above file.
Not sure what I am doing wrong.
回答1:
This feature is available from 1.10.12 version only.
来源:https://stackoverflow.com/questions/65224139/airflow-cluster-policy-is-not-getting-invoked