Skip to content

fix(bazel): classify bazel client/query failures as infra errors#236

Draft
yushan8 wants to merge 2 commits into
mainfrom
yushan/bazel-query-timeout-error
Draft

fix(bazel): classify bazel client/query failures as infra errors#236
yushan8 wants to merge 2 commits into
mainfrom
yushan/bazel-query-timeout-error

Conversation

@yushan8

@yushan8 yushan8 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Intent:

  • A bazel query timeout (and other bazel query/client 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:

  • 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.

Test Plan

unit test

Revert Plan

Revert this PR; classification falls back to the existing ErrorInfra default.

Issues

yushan8 added 2 commits July 23, 2026 17:42
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>
@yushan8 yushan8 changed the title fix(bazel): classify bazel query timeout as an infra error fix(bazel): classify bazel client/query failures as infra errors Jul 24, 2026
Comment thread graphrunner/native.go
g.emitter.DurationHistogram(_opCompute, "bazel_query_duration", _phaseDurationBuckets).RecordDuration(time.Since(bazelStart))
if err != nil {
return targethasher.EmptyResult(), err
return targethasher.EmptyResult(), classifyBazelQueryError(err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks simple enough to inline ?

return targethasher.Empty, tangoerrors.NewInfra(error.Wrap(err, "baze query fail..."))

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