Skip to content

air: send submit's config validation over the CLI's existing connection - #7210

Merged
stevenchen-db merged 4 commits into
mainfrom
schen/air-validate-shared-connection
Nov 9, 2026
Merged

stevenchen-db merged 4 commits into
mainfrom
schen/air-validate-shared-connection

Conversation

@stevenchen-db

@stevenchen-db stevenchen-db commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Changes

air run sends its config:validate request through an SDK client, so it reuses the workspace connection the CLI's other calls already opened instead of opening a second TCP and TLS connection. The request is built the same way as before and still gets exactly one attempt. It now also appears in --debug logs.

One behavior change: the SDK reports a failed response-body read without the HTTP status. A caller-error response (e.g. 401) whose body stalls mid-read now counts as validation being unavailable, so the submission continues. The server validates the run again when it starts.

Why

Since #7368, validation runs alongside the artifact upload and submit waits for both. The extra handshake only delays submit once it makes validation finish after the upload, which happens for clients far from their workspace. Measured on e2-dogfood with emulated extra round trip, time until submit can start (median):

Added round trip main this PR
+0ms / +50ms no difference (upload finishes last)
+100ms ~951ms ~867ms
+200ms ~1748ms ~1479ms

Tests

  • New TestPreflightValidationReusesSDKConnection: an SDK call followed by validation opens one connection (2 on main).
  • TestPreflightValidationBodyReadFailureOnCallerErrorBlocks is now ...FailsOpen, for the behavior change above.
  • go test ./cmd/air/ and go test ./acceptance -run TestAccept/air pass; lint is clean.

This pull request and its description were written by Isaac.

The submit-path config:validate request used its own clone of
http.DefaultTransport, so every `air run` opened a second TCP and TLS
connection to the workspace. Send it through an SDK client instead, so it
reuses the connection the CLI's other calls already opened. The request is
still built the same way and gets one attempt.

The SDK reports a failed response-body read without the HTTP status, so a
caller-error response whose body stalls now counts as validation being
unavailable and the submission continues; the server validates the run again
when it starts.

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 Oct 28, 2026
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 24b00f0

Run: 42682779194

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 271 15 4:22
✅​ aws-windows-latest-4core-16gb 273 13 3:18
✅​ azure linux-2core-8gb 270 15 4:46
✅​ azure-windows-latest-4core-16gb 272 13 3:24
✅​ gcp linux-2core-8gb 271 15 4:03
✅​ gcp-windows-latest-4core-16gb 273 13 3:11
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:05 gcp-windows-latest-4core-16gb TestAccept
3:02 aws-windows-latest-4core-16gb TestAccept
2:56 azure-windows-latest-4core-16gb TestAccept

@maggiewang-db maggiewang-db left a comment

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.

Can you do an E2E test and make sure databricks air run works?

@stevenchen-db
stevenchen-db added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit b694c4c Nov 9, 2026
28 checks passed
@stevenchen-db
stevenchen-db deleted the schen/air-validate-shared-connection branch November 9, 2026 23:02
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