What happened

ServerBoss.start() used scope.launch { task.start() } inside the serverJob coroutine body, which launched tasks into the parent scope rather than as structured children of serverJob. Tasks were siblings of serverJob, not its children. If serverJob were ever cancelled independently of the parent scope, its tasks would continue running orphaned with no owner.

Additionally, catch (t: Throwable) swallowed CancellationException on normal shutdown, logging a spurious error on every server stop and preventing proper cancellation propagation. A prior code review (2026-02-26) flagged this as Medium severity; the nightly bug-hunt (2026-06-19) re-surfaced it via a structural scan.

Fix

Prevention