diff --git a/airflow/dag_processing/manager.py b/airflow/dag_processing/manager.py index 0e9f8b4bc37b0..e48154dec4e00 100644 --- a/airflow/dag_processing/manager.py +++ b/airflow/dag_processing/manager.py @@ -39,7 +39,6 @@ from typing import TYPE_CHECKING, Any, NamedTuple import attrs -from setproctitle import setproctitle from sqlalchemy import delete, select, update from tabulate import tabulate from uuid6 import uuid7 @@ -181,7 +180,15 @@ def _run_processor_manager( # to iterate the child processes set_new_process_group() - setproctitle("airflow scheduler -- DagFileProcessorManager") + + # setproctitle causes issue on Mac OS: https://github.com/benoitc/gunicorn/issues/3021 + os_type = sys.platform + if os_type == "darwin": + log.info("Mac OS detected, skipping setproctitle") + else: + from setproctitle import setproctitle + setproctitle("airflow scheduler -- DagFileProcessorManager") + reload_configuration_for_dag_processing() processor_manager = DagFileProcessorManager( dag_directory=dag_directory, diff --git a/task_sdk/src/airflow/sdk/execution_time/task_runner.py b/task_sdk/src/airflow/sdk/execution_time/task_runner.py index 48dd3ecbfcd67..51230d0e7130f 100644 --- a/task_sdk/src/airflow/sdk/execution_time/task_runner.py +++ b/task_sdk/src/airflow/sdk/execution_time/task_runner.py @@ -214,9 +214,14 @@ def startup() -> tuple[RuntimeTaskInstance, Logger]: msg = SUPERVISOR_COMMS.get_message() if isinstance(msg, StartupDetails): - from setproctitle import setproctitle - - setproctitle(f"airflow worker -- {msg.ti.id}") + # setproctitle causes issue on Mac OS: https://github.com/benoitc/gunicorn/issues/3021 + os_type = sys.platform + if os_type == "darwin": + log.info("Mac OS detected, skipping setproctitle") + else: + from setproctitle import setproctitle + + setproctitle(f"airflow worker -- {msg.ti.id}") log = structlog.get_logger(logger_name="task") # TODO: set the "magic loop" context vars for parsing