fix(core): Stop task process correctly in native Python runner (#20840)

This commit is contained in:
Iván Ovejero
2025-10-16 10:45:02 +02:00
committed by GitHub
parent 37aa81d6cd
commit c560f05a39
2 changed files with 2 additions and 2 deletions
@@ -160,6 +160,7 @@ class TaskExecutor:
if process.is_alive():
process.kill()
process.join()
except (ProcessLookupError, ConnectionError, BrokenPipeError):
# subprocess is dead or unreachable
pass
@@ -372,8 +372,7 @@ class TaskRunner:
if task_state.status == TaskStatus.RUNNING:
task_state.status = TaskStatus.ABORTING
self.executor.stop_process(task_state.process)
await asyncio.to_thread(self.executor.stop_process, task_state.process)
self.logger.info(
LOG_TASK_CANCEL.format(task_id=task_id, **task_state.context())
)