{"record":{"id":"8c204f5f384c4039","repo":"mlflow/mlflow","slug":"setup-libc-prctl-pr-set-pdeathsig-failed-error-e","errorCode":null,"errorMessage":"Setup libc.prctl PR_SET_PDEATHSIG failed, error {e!r}.","messagePattern":"Setup libc\\.prctl PR_SET_PDEATHSIG failed, error (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mlflow/pyfunc/backend.py","lineNumber":283,"sourceCode":"                PySpark daemon and worker reuse settings.\n                We use prctl to ensure the command process receives SIGTERM after spark job\n                cancellation.\n                The command process itself should handle SIGTERM properly.\n                This is a no-op on macOS because prctl is not supported.\n\n                Note:\n                When a pyspark job canceled, the UDF python process are killed by signal \"SIGKILL\",\n                This case neither \"atexit\" nor signal handler can capture SIGKILL signal.\n                prctl is the only way to capture SIGKILL signal.\n                \"\"\"\n                try:\n                    libc = ctypes.CDLL(\"libc.so.6\")\n                    # Set the parent process death signal of the command process to SIGTERM.\n                    libc.prctl(1, signal.SIGTERM)  # PR_SET_PDEATHSIG, see prctl.h\n                except OSError as e:\n                    # TODO: find approach for supporting MacOS/Windows system which does\n                    #  not support prctl.\n                    warnings.warn(f\"Setup libc.prctl PR_SET_PDEATHSIG failed, error {e!r}.\")\n\n        else:\n            setup_sigterm_on_parent_death = None\n\n        if not is_windows():\n            # Add \"exec\" before the starting scoring server command, so that the scoring server\n            # process replaces the bash process, otherwise the scoring server process is created\n            # as a child process of the bash process.\n            # Note we in `mlflow.pyfunc.spark_udf`, use prctl PR_SET_PDEATHSIG to ensure scoring\n            # server process being killed when UDF process exit. The PR_SET_PDEATHSIG can only\n            # send signal to the bash process, if the scoring server process is created as a\n            # child process of the bash process, then it cannot receive the signal sent by prctl.\n            # TODO: For Windows, there's no equivalent things of Unix shell's exec. Windows also\n            #  does not support prctl. We need to find an approach to address it.\n            command = \"exec \" + command\n\n        if self._env_manager != em.LOCAL:\n            return self.prepare_env(local_path).execute(","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/pyfunc/backend.py#L265-L301","documentation":"Error \"Setup libc.prctl PR_SET_PDEATHSIG failed, error {e!r}.\" thrown in mlflow/mlflow.","triggerScenarios":"Thrown at mlflow/pyfunc/backend.py:283 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}