fix(agent): run Ansible executor in worker
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m36s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled

This commit is contained in:
ogt
2026-07-10 17:04:53 +08:00
parent 04d98058fe
commit 4b2ef8b63f
6 changed files with 115 additions and 2 deletions

View File

@@ -390,6 +390,10 @@ async def _run_ansible_command(spec: AnsibleCommandSpec, *, timeout_seconds: int
timed_out = True
process.kill()
stdout_bytes, stderr_bytes = await process.communicate()
except asyncio.CancelledError:
process.kill()
await process.communicate()
raise
duration_ms = int((time.monotonic() - started) * 1000)
return AnsibleRunResult(
returncode=124 if timed_out else int(process.returncode or 0),