We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8478778 commit 7ef901dCopy full SHA for 7ef901d
sqlmesh/core/constants.py
@@ -1,6 +1,7 @@
1
from __future__ import annotations
2
3
import datetime
4
+import multiprocessing as mp
5
import os
6
import typing as t
7
from pathlib import Path
@@ -35,7 +36,7 @@
35
36
# None means default to process pool, 1 means don't fork, :N is number of processes
37
# Factors in the number of available CPUs even if the process is bound to a subset of them
38
# (e.g. via taskset) to avoid oversubscribing the system and causing kill signals
-if hasattr(os, "fork"):
39
+if hasattr(os, "fork") and not mp.current_process().daemon:
40
try:
41
MAX_FORK_WORKERS: t.Optional[int] = int(os.getenv("MAX_FORK_WORKERS")) # type: ignore
42
except TypeError:
0 commit comments