mlflow/mlflow · error
Setup libc.prctl PR_SET_PDEATHSIG failed, error {e!r}.
Error message
Setup libc.prctl PR_SET_PDEATHSIG failed, error {e!r}. What it means
Error "Setup libc.prctl PR_SET_PDEATHSIG failed, error {e!r}." thrown in mlflow/mlflow.
Source
Thrown at mlflow/pyfunc/backend.py:283
PySpark daemon and worker reuse settings.
We use prctl to ensure the command process receives SIGTERM after spark job
cancellation.
The command process itself should handle SIGTERM properly.
This is a no-op on macOS because prctl is not supported.
Note:
When a pyspark job canceled, the UDF python process are killed by signal "SIGKILL",
This case neither "atexit" nor signal handler can capture SIGKILL signal.
prctl is the only way to capture SIGKILL signal.
"""
try:
libc = ctypes.CDLL("libc.so.6")
# Set the parent process death signal of the command process to SIGTERM.
libc.prctl(1, signal.SIGTERM) # PR_SET_PDEATHSIG, see prctl.h
except OSError as e:
# TODO: find approach for supporting MacOS/Windows system which does
# not support prctl.
warnings.warn(f"Setup libc.prctl PR_SET_PDEATHSIG failed, error {e!r}.")
else:
setup_sigterm_on_parent_death = None
if not is_windows():
# Add "exec" before the starting scoring server command, so that the scoring server
# process replaces the bash process, otherwise the scoring server process is created
# as a child process of the bash process.
# Note we in `mlflow.pyfunc.spark_udf`, use prctl PR_SET_PDEATHSIG to ensure scoring
# server process being killed when UDF process exit. The PR_SET_PDEATHSIG can only
# send signal to the bash process, if the scoring server process is created as a
# child process of the bash process, then it cannot receive the signal sent by prctl.
# TODO: For Windows, there's no equivalent things of Unix shell's exec. Windows also
# does not support prctl. We need to find an approach to address it.
command = "exec " + command
if self._env_manager != em.LOCAL:
return self.prepare_env(local_path).execute(View on GitHub (pinned to 6a27f2decc)
When it happens
Trigger: Thrown at mlflow/pyfunc/backend.py:283 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of mlflow/mlflow@6a27f2decc (2026-08-29).
Data as JSON: /api/errors/8c204f5f384c4039.
Report an issue: GitHub.