diff --git a/airflow/task/task_runner/base_task_runner.py b/airflow/task/task_runner/base_task_runner.py index 61d32b7f5a541..f70020de9b544 100644 --- a/airflow/task/task_runner/base_task_runner.py +++ b/airflow/task/task_runner/base_task_runner.py @@ -183,4 +183,9 @@ def on_finish(self) -> None: subprocess.call(['sudo', 'rm', self._cfg_path], close_fds=True) else: os.remove(self._cfg_path) - self._error_file.close() + try: + self._error_file.close() + except FileNotFoundError: + # The subprocess has deleted this file before we do + # so we ignore + pass