Repository navigation
Commit b694c4c
air: send submit's config validation over the CLI's existing connection (#7210)
## 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.
---------
Co-authored-by: Isaac <no-reply@databricks.com>1 parent 77950b6 commit b694c4c
3 files changed
Lines changed: 38 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
156 | 154 | | |
157 | 155 | | |
158 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
186 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
187 | 191 | | |
188 | 192 | | |
189 | 193 | | |
| |||
201 | 205 | | |
202 | 206 | | |
203 | 207 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
209 | 232 | | |
210 | 233 | | |
211 | 234 | | |
| |||
0 commit comments