Skip to content

feat(gax): align resumable upload chunk size to server granularity and surface effective chunk size - #14670

Draft
whowes wants to merge 1 commit into
mainfrom
whowes/align-chunk-size
Draft

whowes wants to merge 1 commit into
mainfrom
whowes/align-chunk-size

Conversation

@whowes

@whowes whowes commented Oct 16, 2026

Copy link
Copy Markdown
Contributor
  • Align the user-provided chunk size to the server-provided X-Goog-Upload-Chunk-Granularity in ResumableUploadFutureImpl once session initiation completes.
  • Surface the resolved chunk size via ResumableUploadFuture.getEffectiveChunkSize(), ResumableUploadProgress.getEffectiveChunkSize(), and in terminal ApiException messages alongside the upload URL.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces the concept of an 'effective chunk size' to the resumable upload process, aligning the configured chunk size with the server's chunk granularity and exposing it via ResumableUploadFuture and ResumableUploadProgress. Feedback on these changes highlights two key concurrency and safety improvements in ResumableUploadFutureImpl.java: first, avoiding a potential NullPointerException by formatting the nullable effectiveChunkSize with %s instead of %d and localizing volatile reads; second, ordering volatile writes so that effectiveChunkSize is written before uploadSessionUrl to ensure consistent visibility across threads.

@whowes
whowes force-pushed the whowes/align-chunk-size branch from 0ad413f to 5616230 Compare October 16, 2026 18:17
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@whowes
whowes added this pull request to stack #14678 October 16, 2026 23:06

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant