Skip to content

Retry overwriting file writes on unexpected EOF - #7611

Merged
denik merged 1 commit into
mainfrom
denik/retry-overwrite-unexpected-eof
Nov 15, 2026
Merged

denik merged 1 commit into
mainfrom
denik/retry-overwrite-unexpected-eof

Conversation

@denik

@denik denik commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Why

File uploads to POST /api/2.0/workspace-files/import-file sometimes fail with a transport error when the connection is cut mid-request. sync and bundle deploy then fail outright. On Azure this hit 14 tests in the last two weeks, mostly on main: integration/cmd/sync tests and bundle acceptance tests that upload files.

Error: Post "[DATABRICKS_URL]/api/2.0/workspace-files/import-file/[PATH]": unexpected EOF

The retrying filer (libs/retry) already retries overwriting writes on 5xx and on the SDK inactivity timeout, but with IsTransient, which leaves out unexpected EOF. #7129 added unexpected EOF and REFUSED_STREAM retries for reads only. An overwrite is just as idempotent, and a 504 or inactivity timeout, which writes already retry, leaves the same uncertainty about whether the server applied the request.

Changes

retryingFiler.Write with OverwriteIfExists now uses IsTransientRead, the same check that Read, ReadDir and Stat use. Writes without overwrite and Delete keep IsTransient. Doc comments are updated to match.

Tests

  • New unit test TestFilerRetriesWriteOnUnexpectedEOF: fails without the change and passes with it.
  • go test ./libs/retry ./libs/sync ./bundle/deploy/... and the cmd/sync, bundle/sync and cmd/fs acceptance tests pass locally.

Dashboard

error snippet
error/180 Error: Post "[DATABRICKS_URL]/api/2.0/workspace-files/import-file/[PATH]": unexpected EOF

This pull request and its description were written by Isaac.

Writes with OverwriteIfExists are idempotent and already retry 5xx and
the SDK inactivity timeout. Also retry the transport errors reads retry
(unexpected EOF, REFUSED_STREAM): import-file uploads fail with
"unexpected EOF" when the connection is cut mid-request.

Co-authored-by: Isaac <no-reply@databricks.com>
@denik denik added the ai-auto PRs made by AI loops & factories, label Nov 13, 2026
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 607ee14

Run: 43461429047

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 15 7:04
💚​ aws-windows-latest-4core-16gb 1 272 13 5:05
💚​ azure linux-2core-8gb 1 269 15 8:10
💚​ azure-windows-latest-4core-16gb 1 271 13 5:38
💚​ gcp linux-2core-8gb 1 270 15 8:26
💚​ gcp-windows-latest-4core-16gb 1 272 13 5:31
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 4 slowest tests (at least 2 minutes):
duration env testname
4:34 aws-windows-latest-4core-16gb TestAccept
3:17 gcp-windows-latest-4core-16gb TestAccept
3:14 azure-windows-latest-4core-16gb TestAccept
2:00 azure linux-2core-8gb TestFilerRecursiveDelete/workspace_files_extensions

@denik
denik marked this pull request as ready for review November 13, 2026 18:18
@denik
denik requested a review from a team as a code owner November 13, 2026 18:18
@denik
denik added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 20fef7c Nov 15, 2026
28 checks passed
@denik
denik deleted the denik/retry-overwrite-unexpected-eof branch November 15, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-auto PRs made by AI loops & factories,

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants