This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
fix/repo-updater: add WARN level logs every time we sync a code host #64519
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes https://linear.app/sourcegraph/issue/SRC-557/sourcegraph-deleted-all-repos-during-github-outage
Github recently had an incident, that caused a number of Sourcegraph's users repos to be deleted and recloned.
After auditing the code, we believe a number / most of these cases are a form of a byzantine fault. Namely, the github API was failing in such a way that it was returning valid-looking (200 status code, well-formed JSON responses) responses that were otherwise incorrect (e.g. returning an empty list
[]
for the set of repositories) instead of a more easily detectable error (non-200 status code, malformed JSON, etc.)In order to be able to determine this in the future, this PR adds more WARN level logs to the syncing logic that logs the number of repositories that were added/removed/modified/etc. + whether or not an error occurred during every sync.
We chose the
WARN
log level to that it will be emitted by default on all Sourcegraph deployments. This will make for more voluminous logs, but its a critical debugging tool that we need.Test plan
Run
sg start
, and see repo-updater logs that look like:Changelog
repo-updater now emits logs that log the result of every code host sync.