Skip to content

Peer sync downgrades still-withheld mirrors to Plain on a transient withheld-paths error #48

@beardthelion

Description

@beardthelion

Surfaced by CodeRabbit on #46 (review spans the full stack; this is peer-sync code from #35).

In sync.rs the per-repo sync does:

let withheld = fetch_withheld(client, &origin_url, owner_short, repo_name).await;
let mode = classify_mirror(withheld);

fetch_withheld collapses 404, 5xx, network errors, and parse failures all into None, and classify_mirror(None) yields MirrorMode::Plain. For an existing promisor mirror that flows into fetch_repo(.., Plain), which clears remote.origin.promisor and remote.origin.partialclonefilter before refetching. So a transient withheld-paths outage against a still-withheld repo downgrades the mirror to a full clone and starts failing syncs until the endpoint recovers.

Only downgrade to Plain on a definite Some(empty). When the lookup is unknown (None from an error), preserve the repo's existing promisor/partial-clone mode instead of reclassifying.

Owning PR: #35.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions