From 5fe56097addd1092ed87d388641c24cbfb3dabb9 Mon Sep 17 00:00:00 2001 From: Jens Scheffler Date: Sun, 4 Jan 2026 00:25:02 +0100 Subject: [PATCH] Suppress Warning in Executor for Supervisor on os.fork() --- task-sdk/src/airflow/sdk/execution_time/supervisor.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/task-sdk/src/airflow/sdk/execution_time/supervisor.py b/task-sdk/src/airflow/sdk/execution_time/supervisor.py index b87131aa7336d..ca810940d2947 100644 --- a/task-sdk/src/airflow/sdk/execution_time/supervisor.py +++ b/task-sdk/src/airflow/sdk/execution_time/supervisor.py @@ -29,6 +29,7 @@ import sys import threading import time +import warnings import weakref from collections import deque from collections.abc import Callable, Generator @@ -477,6 +478,13 @@ def start( # Open the socketpair before forking off the child, so that it is open when we fork. child_logs, read_logs = socketpair() + # Prevent on console: + # DeprecationWarning: This process (pid=NNN) is multi-threaded, use of fork() may lead to deadlocks in the child. + warnings.filterwarnings( + "ignore", + module="airflow.sdk.execution_time.supervisor", + message=".*use of fork() may lead to deadlocks in the child.", + ) pid = os.fork() if pid == 0: # Close and delete of the parent end of the sockets.