Airflow Cluster Policy is not getting invoked

廉价感情. 提交于 2021-01-28 11:15:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!