Repository navigation
Conversation
fs cp from a Volume or DBFS to a Volume streams the source download into the Files API upload. #7559 retries uploads only for seekable readers, so a single 503 (e.g. "Azure is temporarily unavailable; try again later.") on that upload still failed the copy. Buffer non-seekable bodies of up to 8 MiB so they can be replayed; larger streams keep one attempt. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
✅ Integration test reportCommit: 4a696ee
Top 3 slowest tests (at least 2 minutes):
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
FilesClient.Write(UC Volumes) now buffers a non-seekable upload body of up to 8 MiB in memory, so the upload is retried on 408/429/502/503/504 like a seekable one. Bodies over 8 MiB are streamed with one attempt, as before.Why
#7559 retries Files API uploads by rewinding a seekable reader.
fs cpfrom a Volume or from DBFS to a Volume passes the source's download stream toWrite, which is not seekable, so a single 503 on the upload still failed the copy. A local source (*os.File) is seekable and already covered.The errors below are HTTP 503 from the Files API. All failures in the window predate #7556 and #7559 (merged 2026-11-12 ~18:10 UTC). One later PR failure ran on a stacked branch that does not include them. Those PRs cover reads, stats, deletes, mkdir and seekable writes, including the test-setup writes behind most of these failures. This PR closes the remaining gap: remote-to-Volume copies.
Decisions:
cmd/fs, so every caller (fs cp, bundle uploads of generated content) gets it, and the size does not have to be known up front.Open points for the reviewer:
cpFileToFilewould re-open the source withsourceFiler.Readand retry theWrite. That covers files of any size with no buffering, but only forfs cp, andcmd/fswould need its own status-code policy. I went with the smaller, filer-local change. Happy to switch.Tests
TestFilesClientDoesNotRetryNonSeekableUploadwith three tests.TestFilesClientRetriesSmallNonSeekableUploadcovers a body of exactly the buffer size and fails without the fix.TestFilesClientRetriesSmallPipeUploadcovers an*os.Filewhose Seek fails.TestFilesClientDoesNotRetryLargeNonSeekableUploadchecks a larger body gets one attempt and is sent in full. The tests lower the limit to a few bytes.go test -race ./libs/filer/ ./cmd/fs/and localTestAccept/cmd/fspass.integration/cmd/fsTestFsCpDir,TestFsCpDirToDirFileNotOverwritten,TestFsCpFileToFileFileNotOverwrittenandTestFsRmEmptyDirpass, all variants. A 503 cannot be forced on cloud.Dashboard
databricks-api error: Azure is temporarily unavailable; try again later.(17 failures, 13 tests, Azure)databricks-api error: GCP is temporarily unavailable; try again later.(6 failures, GCP)databricks-api error: The service at /api/2.0/fs/files/[PATH] is temporarily unavailable. Please try again later.Remote-to-Volume tests this PR covers:
AI agent (harness_auto).
This pull request and its description were written by Isaac.