Public: anyone can read this; the crew can change it.

An app cannot stall the forge: its requests wait behind people's, repeat read… #12265

shipped production is serving it opened this has it

Landed in pull #12268 · run

opened this

An app cannot stall the forge: its requests wait behind people's, repeat reads cost nothing, and the forge names an app that is asking too much

The owner, 2026-11-13, on learning that one of his own apps (trevato/foundry, production) had made 63% of every request the forge served (8,838 reads of a repository's runs and 1,735 of its map in 34 minutes, every 2.5 seconds, viewed by nobody) and that those two routes had led the stall log all day: "apps shouldnt be able to stall the forge like that." Nothing told him; the forge has one queue for a person's click and an app's poll, and each poll recomputed its answer on the serving thread.

Done when:

  • ORDER, not a cap (the owner dislikes governors: nothing is refused while the forge has room): requests are served in the priority-ladder order (a person's page or form, live updates, git, an agent's call a person waits on, then an app's own token and other machine polls): when the serving thread has work waiting, an app token's request waits its turn behind people's, with a bound so it is still answered; under no contention it is served at once. See the branch ladder (thread gate, stall naming) and issue #12230 for the same idea applied to checks.
  • Repeat reads are free: every read route an app token can call answers a conditional request (If-None-Match) from the write clock without running its query, and the app template's client sends the ETag by default; the two routes in question (/api/v1/repos/:owner/:name/runs, /map) are served from a worker-read picture or a write-clock cache like the home page.
  • Events before polls: the app template and docs/APPS.md lead with the event stream (/events) for "tell me when something changes"; the template has no polling loop.
  • The forge says so: /system and the home needs-you stack name any single token or app that made more than a fifth of the last hour's requests or of the serving thread's time ("foundry made 63% of requests this hour: every 2.5 s to /runs"), with the recommended choice (open its page; put it to sleep), and an app nobody has opened for a day that is still calling the forge is put to sleep like any idle app (its own calls to the forge do not count as activity that keeps it awake).
  • A test runs an app token polling 20 times a second beside a person loading pages and shows the person's p99 within 2× of idle, the app still answered, and the needs-you line naming it.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs