Skip to content

repo_synchronizer: don't ignore fetch errors (bug 2082293) - #173

Open
jcristau wants to merge 1 commit into
mozilla-conduit:mainfrom
jcristau:bug2082293-fetch-errors
Open

jcristau wants to merge 1 commit into
mozilla-conduit:mainfrom
jcristau:bug2082293-fetch-errors

Conversation

@jcristau

Copy link
Copy Markdown
Contributor

fetch_all_from_remote's check for an empty remote was inverted: it raised only when the remote was empty, and silently ignored every other fetch failure. Ignore only the "couldn't find remote ref HEAD" error that git (and cinnabar) report for an empty repository, and let other errors propagate.

The check was added in 6a80f4e ("fix: handle empty repo"), and inverted in 491720b (#26, "Automatically retry actions that touch the network"), presumably by mistake: retry() only retries on exceptions, so swallowing the errors also defeated the retries.

Do this check inside the retried callable, so an empty remote isn't retried, and drop the now-redundant retry around fetch_all_from_remote in _ensure_cinnabar_metadata, which would otherwise nest with the inner one.

In verbose mode, stderr is streamed to the log, so it wasn't included in the GitCommandError and the empty-remote check couldn't work: collect it and pass it to proc.wait().

fetch_all_from_remote's check for an empty remote was inverted: it
raised only when the remote was empty, and silently ignored every other
fetch failure. Ignore only the "couldn't find remote ref HEAD" error
that git (and cinnabar) report for an empty repository, and let other
errors propagate.

The check was added in 6a80f4e ("fix: handle empty repo"), and
inverted in 491720b (mozilla-conduit#26, "Automatically retry actions that touch the
network"), presumably by mistake: retry() only retries on exceptions,
so swallowing the errors also defeated the retries.

Do this check inside the retried callable, so an empty remote isn't
retried, and drop the now-redundant retry around fetch_all_from_remote
in _ensure_cinnabar_metadata, which would otherwise nest with the inner
one.

In verbose mode, stderr is streamed to the log, so it wasn't included
in the GitCommandError and the empty-remote check couldn't work: collect
it and pass it to proc.wait().
@jcristau
jcristau marked this pull request as ready for review October 15, 2026 06:56
@jcristau
jcristau requested a review from a team as a code owner October 15, 2026 06:56

@shtrom shtrom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@shtrom

shtrom commented Oct 21, 2026

Copy link
Copy Markdown
Member

Pushed to dev along with #174 and #172.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants