fix(bazel): classify bazelisk download network failures as retryable - #236
Merged
Conversation
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..."))
Contributor
Author
There was a problem hiding this comment.
Updated. We have different errors based on the exit code so this needs to be wrapped in a function to classify them.
yushan8
force-pushed
the
yushan/bazel-query-timeout-error
branch
from
July 27, 2026 16:47
0c6e0ed to
c9b8d63
Compare
yushan8
marked this pull request as ready for review
July 27, 2026 16:55
xytan0056
reviewed
Jul 27, 2026
| streamErr := g.Wait() | ||
| if waitErr != nil { | ||
| if isGraphFailure(waitErr) { | ||
| return queryResults, b.wrapQueryFailure("bazel query failed", fmt.Errorf("%w: %w", ErrQueryGraphFailure, waitErr), &stderrBuf) |
Contributor
There was a problem hiding this comment.
@justinwon777
CLI imports this pacakge , does this error surface to bk jobs (end up a specific error code) and get classified accordingly? or should we let uber's bk classifier take over everything?
Summary: Intent: - A bazel client creation failure previously returned a plain error that fell through to the ErrorInfra default in tangoerrors.GetErrorCode -- correct by accident, not by design. A transient network failure while downloading bazelisk is retryable and shouldn't be lumped in with permanent infra failures (e.g. a bad BazelCommand path). Changes: - Add bazel.ErrDownloadBazeliskNetwork, wrapped when downloading bazelisk fails with a net.Error. - Add orchestrator.classifyBazelClientError, classifying ErrDownloadBazeliskNetwork as tangoerrors.ErrorInfraRetryable and everything else as tangoerrors.ErrorInfra; wired into nativeOrchestrator. ## Test Plan unit test ## Revert Plan Revert this PR; classification falls back to the existing ErrorInfra default. --- <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>
yushan8
force-pushed
the
yushan/bazel-query-timeout-error
branch
from
July 27, 2026 20:30
0f24f7c to
5d5ed61
Compare
Review feedback: the sentinel fires on any net.Error, not something specific to bazelisk downloads, and the old name doubled up with the "download bazelisk" prefix already added at the call site. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
xytan0056
approved these changes
Jul 28, 2026
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:
fell through to the ErrorInfra default in tangoerrors.GetErrorCode --
correct by accident, not by design. A transient network failure while
downloading bazelisk is retryable and shouldn't be lumped in with
permanent infra failures (e.g. a bad BazelCommand path).
Changes:
fails with a net.Error.
ErrDownloadBazeliskNetwork as tangoerrors.ErrorInfraRetryable and
everything else as tangoerrors.ErrorInfra; wired into nativeOrchestrator.
Test Plan
unit test
Revert Plan
Revert this PR; classification falls back to the existing ErrorInfra default.
Issues