mirror of
https://github.com/n8n-io/n8n.git
synced 2026-09-21 04:37:50 +08:00
fix(core): Stop task process correctly in native Python runner (#20840)
This commit is contained in:
@@ -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())
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user