diff --git a/task_sdk/src/airflow/sdk/execution_time/supervisor.py b/task_sdk/src/airflow/sdk/execution_time/supervisor.py index cb5554681b303..677030b7bdce2 100644 --- a/task_sdk/src/airflow/sdk/execution_time/supervisor.py +++ b/task_sdk/src/airflow/sdk/execution_time/supervisor.py @@ -412,8 +412,13 @@ def _on_child_started(self, ti: TaskInstance, path: str | os.PathLike[str], requ # Send the message to tell the process what it needs to execute log.debug("Sending", msg=msg) - self.stdin.write(msg.model_dump_json().encode()) - self.stdin.write(b"\n") + + try: + self.stdin.write(msg.model_dump_json().encode()) + self.stdin.write(b"\n") + except BrokenPipeError: + # Debug is fine, the process will have shown _something_ in it's last_chance exception handler + log.debug("Couldn't send startup message to Subprocess - it died very early", pid=self.pid) def kill( self,