Skip to main content

serve_fetch_round

Function serve_fetch_round 

Source
pub async fn serve_fetch_round(
    writer: &mut impl PktLineWriter,
    request: &Request,
    rounds: &mut FetchRounds,
    packgen: Arc<dyn GitPackGen>,
    repo: &RepoRecord,
    limits: &Limits,
    pipeline: Arc<Semaphore>,
) -> Result<(), SubstrateError>
Expand description

Serves one command=fetch round (ADR-014): budgets, the request parse with the object-format check, the no-done acknowledgments shape, and the done round’s packfile section.

  • rounds — the session’s FetchRounds counter (the entries own its state; this machine enforces the cap).
  • packgen — the backend handle GitPackGen::common_haves and GitPackGen::generate are called through.
  • pipeline — the shared pipeline-concurrency semaphore (ADR-009’s enforcement point): a permit is acquired around the done round’s generate call; exhaustion delays the call (the 503-mapped class).

Every response path is flush-terminated (acknowledgments / the packfile section); an error path emits nothing beyond what was already relayed and returns the terminal error the entries map.