build log --follow follow-ups #251

closed cmc opened this on 2026-09-23 06:24 UTC

Discussion

cmc 2026-09-23 06:24 UTC

Left from #250 (!462), each bounded today by the 10-minute queued limit, the reaper's deadline and the 8-per-account cap:

  • Shutdown does not end open follows. hs.Shutdown does not cancel request contexts, so an open web follow holds the HTTP drain for the full 30 s and the page is cut mid-stream. Fix: hs.BaseContext cancelled on SIGTERM, and a server-wide stopping channel merged into sshd's done.
  • Access is checked once in buildRef. A repository made private, or a viewer losing access, mid-follow keeps streaming until the build ends. Fix: re-run resolveRepo on poll ticks, or record it on the Threat-Model page.
  • Each append wakes every follower and each reads substr(CAST(log AS BLOB), ?), which loads the whole value (up to 2 MB). Fix: wait 100–250 ms after a wake before reading, to coalesce appends.
  • No unit test covers the sshd path from a client closing the session channel to Ctx.Done; for a quiet build it is the only thing that ends a follow.

referenced in commit 79e1555258 by cmc: build log --follow: the follow says a restart ended it

2026-09-23 07:12 UTC

closed by cmc in commit 69cc23d7df: wiki: follows re-check access and end on a restart

2026-09-23 07:12 UTC

referenced in commit 644155a37d by cmc: gitbayd: a restart ends open follows before the drain

2026-09-23 07:12 UTC

referenced in commit 5cc5eff559 by cmc: sshd: Stop ends open follows; test that a closed channel does

2026-09-23 07:12 UTC

referenced in commit 33045f8a24 by cmc: build log --follow: re-check read access, coalesce reads after a wake

2026-09-23 07:12 UTC