fix(bazel): classify bazel client/query failures as infra errors#236
Draft
yushan8 wants to merge 2 commits into
Draft
fix(bazel): classify bazel client/query failures as infra errors#236yushan8 wants to merge 2 commits into
yushan8 wants to merge 2 commits into
Conversation
Summary: Intent: - A bazel query that exceeds the configured query timeout was returned as a plain error, so it fell through to the default infra classification only incidentally rather than being explicitly and durably classified. Changes: - Add core/bazel.ErrQueryTimeout, a sentinel wrapped into the returned error when the query's context deadline is exceeded. - Add graphrunner.classifyBazelQueryError, following the orchestrator/errors.go pattern, which classifies ErrQueryTimeout as tangoerrors.ErrorInfra. - Wire classifyBazelQueryError into nativeGraphRunner.Compute. --- <sub>Generated by the 🪄 [pr-create](https://sg.uberinternal.com/code.uber.internal/uber-code/devexp-agent-marketplace/-/blob/claude-code/plugins/dev/uber-dev/skills/pr-create/SKILL.md) skill in devexp-agent-marketplace</sub>
Summary: Intent: - Any bazel query timeout (and other bazel failures) already fell through to the ErrorInfra default in tangoerrors.GetErrorCode, since nothing wrapped them in a TangoError. Classify these failures explicitly at the two call sites so the classification is intentional rather than incidental, and to give future callers a place to hang more specific classification (e.g. retryable) if it's ever needed. Changes: - Drop the ErrQueryTimeout sentinel added in the previous commit; a bazel query timeout isn't distinguishable from any other bazel query failure for classification purposes. - graphrunner.classifyBazelQueryError now unconditionally wraps a bazel query failure as tangoerrors.NewInfra. - Add orchestrator.classifyBazelClientError, wrapping a bazel.NewBazelClient failure as tangoerrors.NewInfra, and wire it into nativeOrchestrator. --- <sub>Generated by the 🪄 [pr-create](https://sg.uberinternal.com/code.uber.internal/uber-code/devexp-agent-marketplace/-/blob/claude-code/plugins/dev/uber-dev/skills/pr-create/SKILL.md) skill in devexp-agent-marketplace</sub>
xytan0056
reviewed
Jul 24, 2026
| g.emitter.DurationHistogram(_opCompute, "bazel_query_duration", _phaseDurationBuckets).RecordDuration(time.Since(bazelStart)) | ||
| if err != nil { | ||
| return targethasher.EmptyResult(), err | ||
| return targethasher.EmptyResult(), classifyBazelQueryError(err) |
Contributor
There was a problem hiding this comment.
looks simple enough to inline ?
return targethasher.Empty, tangoerrors.NewInfra(error.Wrap(err, "baze query fail..."))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Intent:
through to the ErrorInfra default in tangoerrors.GetErrorCode, since
nothing wrapped them in a TangoError. Classify these failures explicitly
at the two call sites so the classification is intentional rather than
incidental, and to give future callers a place to hang more specific
classification (e.g. retryable) if it's ever needed.
Changes:
query failure as tangoerrors.NewInfra.
failure as tangoerrors.NewInfra, and wire it into nativeOrchestrator.
Test Plan
unit test
Revert Plan
Revert this PR; classification falls back to the existing ErrorInfra default.
Issues