Skip to content
quarry Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 68023e09bfb8adc3cebdaa49384e9365779d01a231e36fcee4f2e6ea43eb5093
Ticket: 9d59ebbfe9854503039c982763910e349f40ce99
Bind the listener before registering repositories, not after
User & Date: dmestas on 2026-08-24 23:00:08
Changes

  1. comment changed to:
    The forge refuses connections for the whole of startup because
    ListenAndServe runs after every repository has been registered, and
    registration is serial and shells out to zit per repo.
    
    Measured on the demo fleet, 2026-08-24: 25 repositories, ~105s from
    process start to bound port. Worst single repo 18.4s (tcl), then sqlite
    12.1s. During that window the site is not slow — it is not listening,
    so every request is a connection refusal rather than a page.
    
    startup-latency bounds the worst offender: 'zit submanifest show' took
    116s on tcl and 16s on sqlite where the code's comment claimed ~250ms,
    and it is capped at 2s now. That turns minutes into ~105s. It does not
    fix the shape.
    
    THE FIX: bind first, register in the background. A request that arrives
    before its repository is ready should get a page saying so — the
    Indexing flag and its surfaces already exist for exactly that state —
    rather than a refused connection, which is indistinguishable from the
    forge being dead. Registration is per-repo independent, so it can also
    run concurrently under the existing ingest lane.
    
    WHAT NOT TO DO: raise the probe timeout, or cache the probe result on
    disk. Both leave a startup path whose cost is a function of how much
    history the fleet holds, which is the actual defect.
    
    Related: 'zit submanifest show' costing 116s on a 94k-artifact store may
    itself be worth a zit issue — it is answering a yes/no question about
    whether any S-bearing artifact exists.
    
  2. priority changed to: "High"
  3. status changed to: "Open"
  4. subsystem changed to: "server"
  5. title changed to:
    Bind the listener before registering repositories, not after
    
  6. type changed to: "Code_Defect"