mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
fix(api): default event loop to asyncio + cancellation-safe commit — kills the CI segfault (#340)
* fix(api): default the event loop to asyncio + cancellation-safe commit The recurring CI e2e segfault traced to uvloop: the harness's uvicorn.run() auto-selected it while production's serve() path never consulted Config.loop (stock asyncio, accidentally safe). Every launch site now resolves ROBOCO_UVICORN_LOOP (default asyncio; uvloop opt-in), and DbCommitMiddleware's commit-in-send can no longer be interrupted mid-wire: on cancellation it gets a bounded grace to finish (committed data survives the 504), else invalidate-and-reraise. * feat(runtime): expected-stop breadcrumbs attribute container deaths Two production exit-143s had no attributable source: every orchestrator kill path now records a short reason breadcrumb, and the exit monitor consumes it -- an expected stop logs its reason at info, a genuinely unexpected one logs none_recorded plus docker-inspect diagnostics (OOMKilled, timestamps) so the next mystery SIGTERM self-identifies. --------- Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
@@ -121,7 +121,9 @@ async def test_broken_past_grace_is_killed(monkeypatch: pytest.MonkeyPatch) -> N
|
||||
monkeypatch.setattr(orch, "_remove_container", remove)
|
||||
monkeypatch.setattr(orch, "_probe_gateway_health", AsyncMock(return_value=False))
|
||||
assert await orch._maybe_recover_broken_gateway(_task()) is True
|
||||
remove.assert_awaited_once_with("roboco-agent-be-dev-1")
|
||||
remove.assert_awaited_once_with(
|
||||
"roboco-agent-be-dev-1", stop_reason="gateway_health_recovery"
|
||||
)
|
||||
assert "be-dev-1" not in orch._instances # evicted
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user