From 92554221becdb91bc9eea244028ba18dbba8869c Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Sat, 23 May 2026 16:04:55 -0700 Subject: [PATCH] skaldsong: enable PYTHONASYNCIODEBUG to surface orphaned-task warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Temporary diagnostic for the class of bug story 83ff386d47c6 hit 2026-05-23: POST /generation/start returned 202, then total silence — no log, no DB state update, py-spy showed event loop idle with no GenerationRunner frame anywhere. Strongly suggests a created_task() result not held → GC'd → silent destroy. PYTHONASYNCIODEBUG=1 emits "Task was destroyed but it is pending" and "Task exception was never retrieved" warnings to stderr; that should distinguish lost-task from cancelled-task on the next attempt. Per skaldsong-dev's note, remove once they wire proper task-exception capture upstream. Diagnosis thread: althing 01KSBGKQBXA756JWW1KD4MPGXM --- stacks/skaldsong/compose.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stacks/skaldsong/compose.yaml b/stacks/skaldsong/compose.yaml index 116c129..97d966c 100644 --- a/stacks/skaldsong/compose.yaml +++ b/stacks/skaldsong/compose.yaml @@ -78,6 +78,15 @@ services: # flat into /app/spa, not into /app/spa/dist). SKALDSONG_HOST_STATIC_ASSETS_PATH: /app/spa + # Temporary debug mode — surfaces "Task was destroyed but it is + # pending" + "Task exception was never retrieved" warnings to + # stderr. Added 2026-05-23 to diagnose a class of orphaned-task + # bugs in the GenerationRunner (story 83ff386d47c6 hit the + # symptom: 202 Accepted, then silent — no log, no DB update, + # event loop idle). Remove once skaldsong has proper + # task-exception capture wired (per skaldsong-dev's note). + PYTHONASYNCIODEBUG: "1" + # Persistent state paths inside the container. The db/ parent # dir is the bind-mount target (not the file itself) so SQLite # can write its WAL + SHM siblings. Names MUST match what the