Skip to content

Commit 7ef901d

Browse files
tobymaoizeigerman
authored andcommitted
fix: disable airflow multiprocessing (#3097)
1 parent 8478778 commit 7ef901d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sqlmesh/core/constants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import datetime
4+
import multiprocessing as mp
45
import os
56
import typing as t
67
from pathlib import Path
@@ -35,7 +36,7 @@
3536
# None means default to process pool, 1 means don't fork, :N is number of processes
3637
# Factors in the number of available CPUs even if the process is bound to a subset of them
3738
# (e.g. via taskset) to avoid oversubscribing the system and causing kill signals
38-
if hasattr(os, "fork"):
39+
if hasattr(os, "fork") and not mp.current_process().daemon:
3940
try:
4041
MAX_FORK_WORKERS: t.Optional[int] = int(os.getenv("MAX_FORK_WORKERS")) # type: ignore
4142
except TypeError:

0 commit comments

Comments
 (0)