feat: one Poll Lane per Site, replacing the shared pace (#100) #106

Merged
sulthan merged 1 commits from feat/100-poll-lanes into main 2026-08-16 13:16:21 +07:00
Owner

Closes #100.

Each Site runs its own Poll Lane: an independent goroutine with its own rest
and pace from the registry (backend/internal/latest/sites.go), replacing the
shared cooldown/interval/stagger/batch configuration. Rest (1h, all six Sites
including the browser trio) is enforced by the due query's WHERE clause; the
Lane sleeps its effective gap between fetches — the registry 10s, or
rest/eligible when a Site holds enough Series, floored at 1s with a
Site-naming warning when the floor engages.

Lane-local failure handling:

  • Two challenge-held results stop that Site's Lane for 15m; the probes keep
    their stamp, untried Series stay due.
  • A lost browser sets a shared Poller flag: the other browser Lanes skip
    their passes for the same 15m (no stamp-per-pass-per-Lane on a dead tab),
    then decay and probe again.
  • Browser wake gate preserved (5 due, or one waiting 15m, ADR-0005); one tab
    shared by the three browser Sites; "browser lane behind by X" logged every
    pass.
  • Cover work (healing a stored source URL and filling a blank from the series
    page) runs in the background so a slow CDN cannot consume a Lane's gap.

Removed: LATEST_CHAPTER_POLL_{COOLDOWN,BROWSER_COOLDOWN,INTERVAL,BATCH,STAGGER}
and the 6h browser rest. Only LATEST_CHAPTER_POLL_ENABLED remains; DEPLOY.md
documents the exact .env edit. ADR-0010 records the decisions.

Closes #100. Each Site runs its own Poll Lane: an independent goroutine with its own rest and pace from the registry (`backend/internal/latest/sites.go`), replacing the shared cooldown/interval/stagger/batch configuration. Rest (1h, all six Sites including the browser trio) is enforced by the due query's WHERE clause; the Lane sleeps its effective gap between fetches — the registry 10s, or rest/eligible when a Site holds enough Series, floored at 1s with a Site-naming warning when the floor engages. Lane-local failure handling: - Two challenge-held results stop that Site's Lane for 15m; the probes keep their stamp, untried Series stay due. - A lost browser sets a shared Poller flag: the other browser Lanes skip their passes for the same 15m (no stamp-per-pass-per-Lane on a dead tab), then decay and probe again. - Browser wake gate preserved (5 due, or one waiting 15m, ADR-0005); one tab shared by the three browser Sites; "browser lane behind by X" logged every pass. - Cover work (healing a stored source URL and filling a blank from the series page) runs in the background so a slow CDN cannot consume a Lane's gap. Removed: `LATEST_CHAPTER_POLL_{COOLDOWN,BROWSER_COOLDOWN,INTERVAL,BATCH,STAGGER}` and the 6h browser rest. Only `LATEST_CHAPTER_POLL_ENABLED` remains; DEPLOY.md documents the exact `.env` edit. ADR-0010 records the decisions.
sulthan added 1 commit 2026-08-16 13:04:43 +07:00
Each Site runs its own poll goroutine, paced by Rest and Gap from the
registry (sites.go) instead of the shared cooldown/interval/stagger/batch
config. Rest is enforced by the due query's WHERE clause; the Lane sleeps
its effective gap between fetches (hour/eligible, floored at 1s).

Lane-local failures: two refusals stop that Site for 15m, a lost browser
stops only the round's remaining browser Lanes, and cover heals moved to
background goroutines so a slow CDN cannot consume a Lane's gap. The five
LATEST_CHAPTER_POLL_* pace env vars are gone; only the kill switch
remains.
sulthan merged commit 3303a55b20 into main 2026-08-16 13:16:21 +07:00
Sign in to join this conversation.