Commit 84864a0
Categorise missing-repo errors as transient (in tier) vs permanent (not in tier)
Summary:
# This Stack
Differentiates two failure modes in the Mononoke `diff_service` Thrift API that today collapse to a single transient `REPO_NOT_FOUND` wire response: (a) the repo is configured in the tier but is not loaded on the receiving ShardManager shard (a routing race) versus (b) the repo does not exist anywhere in the tier configuration (a true 404-class client error). The fix switches `get_repo_context` to consult `Mononoke::repo_names_in_tier` after a `None` from `Mononoke::repo` and emits a permanent `diff_error` for the truly-missing case, while keeping the existing transient `REPO_NOT_FOUND` variant for the routing-race case (SCS retries it via the DiffRouter local fallback). No IDL change — the wire surface and existing client classification are preserved; only the not-in-tier branch becomes a new permanent-error end-state. This unblocks the SLO rewrite that parent SEV S622826 needs (on-call can now write a single filterable Scuba query that excludes the permanent 404 cases) and closes T255966337.
# This Diff
Switches the `get_repo_context` `.ok_or_else` arm from an unconditional transient `REPO_NOT_FOUND` to a routing decision based on tier membership. When `Mononoke::repo` returns `None`, the helper `classify_missing_repo_error` consults `Mononoke::repo_names_in_tier` and emits a transient `REPO_NOT_FOUND` (retried by SCS) if the repo is in the tier configuration, or a permanent `diff_error("repo does not exist: <name>")` (no retry) if it is not. The truly-missing case becomes a permanent error end-state, which skips a wasted local fallback for known-impossible requests. The helper is generic over the concrete `Repo` type so it can be exercised by unit tests against a directly-constructed `Mononoke<Repo>` whose `repos` map is empty. Adds four unit tests in the diff_service server crate (the crate's first \`#[cfg(test)] mod tests\` block) covering both branches and adversarial empty/unicode repo-name cases, and two classifier tests in `scs_methods/src/diff.rs` covering the transient routing-race case and the new permanent `diff_error` shape.
Reviewed By: Juzley
Differential Revision: D105948560
fbshipit-source-id: 0f2cab856f1179643ed82cb53d7059cb9953112a1 parent 319e69a commit 84864a0
1 file changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1336 | 1336 | | |
1337 | 1337 | | |
1338 | 1338 | | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
1339 | 1372 | | |
0 commit comments