Skip to content

air: drop redundant /Me calls from air logs and air get - #7613

Merged
stevenchen-db merged 5 commits into
mainfrom
air/drop-me-precheck
Nov 13, 2026
Merged

stevenchen-db merged 5 commits into
mainfrom
air/drop-me-precheck

Conversation

@stevenchen-db

@stevenchen-db stevenchen-db commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • air logs, air get, and air run --watch called CurrentUser.Me before every GetRun to tell a bad credential apart from a failed request. The probe now runs only when GetRun fails with 401/403, the one case where a bad credential and missing access to the run look the same. Error classification is unchanged.
  • air get built the run URL's ?o= hint with CurrentWorkspaceID, a second /Me request. It now uses auth.ResolveWorkspaceID, as air run does, so the ID comes from the profile, environment, or host metadata.

One behavior change: a configured workspace ID that is not numeric (e.g. DATABRICKS_WORKSPACE_ID=abc with env-only auth) now fails air get with INVALID_ARGS instead of being ignored. That value is also sent as the routing header on every request.

Why

air get drops both /Me calls and air logs drops one. On df1, air logs <id> --node 5 (GetRun plus the local node check) went from 196ms to 101ms median.

Tests

  • Unit: 403 + failing probe stays UNAUTHENTICATED; a transient probe failure stays retryable; a 403 with valid credentials is not an auth failure; the successful air logs test server fails on any /Me; air get uses a configured ID with no /Me, looks it up once when unset, and rejects a non-numeric one.
  • go test ./cmd/air, TestAccept/air, lint pass.
  • Manual e2e on df1 against main, 11 cases (finished run, no workspace_id in profile, bad token, nonexistent run, valid/invalid --node; text and JSON): identical output and exit codes, minus the /Me calls. Also identical air get while a run was pending and after it finished, identical air logs following it live, a watched run to TERMINATED SUCCESS, and air cancel.

This pull request and its description were written by Isaac.

`air logs`, `air get`, and `air run --watch` called CurrentUser.Me before
every GetRun to tell a bad credential apart from a failed request. Run
the probe only when GetRun fails with 401/403, the one case where the
two are ambiguous, so successful calls save a round trip and error
classification is unchanged.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added the AIR Databricks AI Runtime CLI label Nov 13, 2026
`air get` called CurrentWorkspaceID, a second /Me request, to build the
run URL's ?o= hint. Use auth.ResolveWorkspaceID, as `air run` does, so the
ID comes from the profile, environment, or host metadata and /Me is only
called when none is set. A configured ID that is not numeric is now
reported as an invalid argument.

Co-authored-by: Isaac <no-reply@databricks.com>
@stevenchen-db stevenchen-db changed the title air: skip the Me() credential probe unless GetRun is denied air: drop redundant /Me calls from air logs and air get Nov 13, 2026
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 0e11cae

Run: 43520286829

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 15 5:09
💚​ aws-windows-latest-4core-16gb 1 272 13 4:04
💚​ azure linux-2core-8gb 1 269 15 4:53
💚​ azure-windows-latest-4core-16gb 1 271 13 3:25
💚​ gcp linux-2core-8gb 1 270 15 5:10
💚​ gcp-windows-latest-4core-16gb 1 272 13 4:03
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:50 gcp-windows-latest-4core-16gb TestAccept
3:22 aws-windows-latest-4core-16gb TestAccept
3:20 azure-windows-latest-4core-16gb TestAccept

@stevenchen-db
stevenchen-db added this pull request to the merge queue Nov 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 13, 2026
@stevenchen-db
stevenchen-db added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit c4559ed Nov 13, 2026
28 checks passed
@stevenchen-db
stevenchen-db deleted the air/drop-me-precheck branch November 13, 2026 23:06
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

❌ Integration test report

Commit: c4559ed

Run: 43524749037

Env 🔄​flaky 💚​RECOVERED ✅​pass 🙈​skip Time
🔄​ aws linux-2core-8gb 6 8 1621 1316 262:22
💚​ azure linux-2core-8gb 12 1603 1324 198:06
💚​ azure-windows-latest-4core-16gb 12 1522 1351 208:11
💚​ gcp linux-2core-8gb 12 1610 1322 222:20
🔄​ gcp-windows-latest-4core-16gb 3 11 1527 1349 246:42
16 interesting tests: 9 flaky, 7 RECOVERED
Test Name aws linux-2core-8gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
🔄​ TestAccept 💚​R 💚​R 💚​R 💚​R 🔄​f
🔄​ TestAccept/bundle/resources/apps/inline_config 🔄​f ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/resources/apps/inline_config/DMS= 🔄​f ✅​p ✅​p ✅​p ✅​p
💚​ TestAccept/bundle/resources/apps/lifecycle-started 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-omitted 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-omitted/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-toggle 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-toggle/DMS= 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-toggle/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestAccept/bundle/resources/apps/lifecycle-started/DMS= 🔄​f 💚​R 💚​R 💚​R 💚​R
🔄​ TestAccept/bundle/resources/apps/lifecycle-started/DMS=true 🔄​f 💚​R 💚​R 💚​R 💚​R
🔄​ TestAccept/bundle/resources/postgres_endpoints/basic ✅​p ✅​p ✅​p ✅​p 🔄​f
🔄​ TestAccept/bundle/resources/postgres_endpoints/basic/DMS= ✅​p ✅​p ✅​p ✅​p 🔄​f
🔄​ TestAccept/bundle/resources/postgres_synced_tables/recreate 🔄​f 💚​R 💚​R 💚​R 💚​R
🔄​ TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS= 🔄​f 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R
Top 50 slowest tests (at least 2 minutes):
duration env testname
11:38 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
10:05 gcp linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
10:03 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=
9:28 azure-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
9:27 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
9:02 aws linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
8:51 azure linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
8:45 aws linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
8:41 azure-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
8:13 gcp-windows-latest-4core-16gb TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=1
8:11 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=
8:04 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
7:52 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
7:49 azure linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
7:48 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
7:47 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=true
7:45 aws linux-2core-8gb TestAccept/bundle/resources/clusters/deploy/data_security_mode/DMS=
7:31 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=
7:25 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/resize-terminated-fallback/DMS=true
7:17 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
7:15 gcp linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
7:13 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=true
7:12 gcp-windows-latest-4core-16gb TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=
7:09 azure linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
7:03 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
6:57 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
6:40 gcp linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true
6:34 aws linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=
6:33 aws linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true
6:26 azure linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true
6:19 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/deploy/simple/DMS=
6:09 gcp linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=
5:39 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=
5:38 gcp-windows-latest-4core-16gb TestAccept/pipelines/run/refresh-flags
5:32 azure-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
5:30 azure-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
5:21 azure linux-2core-8gb TestAccept/bundle/invariant/destroy_idempotent/DMS=/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=
5:13 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=true
5:11 azure-windows-latest-4core-16gb TestAccept/pipelines/run/refresh-flags
5:03 gcp linux-2core-8gb TestAccept/pipelines/run/refresh-flags
4:59 aws linux-2core-8gb TestAccept/bundle/invariant/destroy_idempotent/DMS=/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=1
4:57 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=
4:52 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=true
4:50 azure linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
4:39 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started-toggle/DMS=true
4:35 aws linux-2core-8gb TestAccept/pipelines/run/refresh-flags
4:31 aws linux-2core-8gb TestAccept/bundle/resources/clusters/deploy/update-after-create/DMS=true
4:31 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=true
4:26 azure linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=
4:24 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/apps/inline_config/DMS=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIR Databricks AI Runtime CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants