GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(gax): enforce global timeout for resumable uploads by whowes · Pull Request #14425 · googleapis/google-cloud-java

Conversation

@whowes

@whowes whowes commented Sep 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Enforces ResumableUploadCallSettings.getGlobalTimeout() in ResumableUploadFutureImpl across the entire upload session lifecycle, including session initiation and chunk streaming. Cancels in-flight RPCs, closes the payload stream, and completes the future with DeadlineExceededException when the deadline is exceeded. The deadline defaults to 15 minutes when unset by the service proto or user.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
gemini-code-assist[bot]

This comment was marked as outdated.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from 3011b46 to 3e2fdd4 Compare September 17, 2026 22:08
@whowes
whowes added this pull request to stack #14429 September 17, 2026 22:16
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from 3e2fdd4 to 4dfdd22 Compare September 17, 2026 22:22
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from 4dfdd22 to 3794533 Compare September 18, 2026 02:23
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch 2 times, most recently from 497d777 to a5ffaf3 Compare September 18, 2026 03:21
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from a5ffaf3 to fc40846 Compare September 18, 2026 15:05
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from fc40846 to 6960f29 Compare September 19, 2026 01:36
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from 6960f29 to 7d98c7b Compare September 19, 2026 21:12
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from 7d98c7b to a355e4a Compare September 19, 2026 22:57
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from a355e4a to c59321f Compare September 19, 2026 23:17
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from c59321f to bf605a2 Compare September 20, 2026 00:19
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from bf605a2 to aacf3b6 Compare September 20, 2026 05:24
@whowes
whowes removed this pull request from stack #14429 September 20, 2026 07:20
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from aacf3b6 to c36f0cd Compare September 20, 2026 07:45
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch 2 times, most recently from 148ba7c to 274e8b0 Compare September 22, 2026 16:45
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from 274e8b0 to 4c5000d Compare September 22, 2026 19:38
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from 4c5000d to 9b5543b Compare September 22, 2026 19:56
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch 4 times, most recently from 0f52c99 to 1c271f8 Compare September 22, 2026 22:06
@whowes

whowes commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot]
gemini-code-assist Bot reviewed Sep 22, 2026
View reviewed changes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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 a global timeout mechanism for resumable uploads in ResumableUploadFutureImpl. By passing ClientContext instead of ApiCallContext, the implementation gains access to the scheduled executor service to schedule a timeout task. If the upload exceeds the global timeout (defaulting to 15 minutes), a DeadlineExceededException is triggered, and any in-flight upload attempts are cancelled. Comprehensive unit tests have been added to verify this timeout behavior under various conditions. There are no review comments to address, and the changes are well-implemented.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@whowes
whowes added this pull request to stack #14476 September 22, 2026 22:13
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from 1c271f8 to 864d8fd Compare September 24, 2026 00:45
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from 864d8fd to 30e10f9 Compare September 24, 2026 01:07
@whowes whowes mentioned this pull request Sep 24, 2026
refactor(gax): remove circular ref between resumable upload future and chunk coordinator #14421
Merged
@whowes
whowes force-pushed the whowes/resumable-upload-watchdog branch from 30e10f9 to 85c246b Compare September 24, 2026 05:53
blakeli0
blakeli0 reviewed Sep 25, 2026
View reviewed changes
Comment thread ...atform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResumableUploadFutureImpl.java
}

private void fail(Throwable t) {
ApiFuture<?> inFlight;

@blakeli0 blakeli0 Sep 25, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There could be a race condition per AI:

  1. onTimeout() → fail() enters synchronized (lock), reads inFlight = startFuture, sets this.inFlightFuture = null, and exits synchronized (lock). At this moment, resultFuture.isDone() is still false.
  2. startFuture.onSuccess() enters synchronized (lock), checks if (resultFuture.isDone()) (which is still false!), sets inFlightFuture = uploadFuture, and exits synchronized (lock).
  3. fail() calls closePayload() and resultFuture.setException(DeadlineExceededException).
  4. startFuture.onSuccess() calls coordinator.start(), launching the background chunk coordinator—and uploadFuture is never cancelled because fail() already cleared inFlightFuture before step 2.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@whowes whowes Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All terminal transitions (succeed, fail, cancel) now return early if inFlightFuture == null; otherwise they null it and complete resultFuture. So only the first one "wins".

startFuture.onSuccess() also checks inFlightFuture == null (instead of resultFuture.isDone()) before installing uploadFuture, so it can't start the coordinator after fail(). If onSuccess() gets there first, fail() now cancels uploadFuture.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...atform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResumableUploadFutureImpl.java Outdated
} else {
message = "Resumable upload timed out before session initiation completed";
}
fail(new DeadlineExceededException(message, null, TIMEOUT_STATUS_CODE, false));

@blakeli0 blakeli0 Sep 25, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe create a DeadlineExceededException directly using ApiExceptionFactory?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@whowes whowes Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
blakeli0
blakeli0 reviewed Sep 25, 2026
View reviewed changes
Comment thread ...atform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResumableUploadFutureImpl.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

blakeli0
blakeli0 approved these changes Sep 28, 2026
View reviewed changes
Comment thread ...atform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResumableUploadFutureImpl.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...atform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResumableUploadFutureImpl.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...atform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResumableUploadFutureImpl.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@whowes
feat(gax): enforce global timeout for resumable uploads
6ce9185
Enforces ResumableUploadCallSettings.getGlobalTimeout() (defaulting to 15 minutes when unset) in ResumableUploadFutureImpl across the entire upload session lifecycle, including session initiation and chunk streaming. Cancels in-flight RPCs, closes the payload stream, and completes the future with DeadlineExceededException when the deadline is exceeded.
@sonarqubecloud

sonarqubecloud Bot commented Sep 28, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed for 'gapic-generator-java-root'

Issues
6 New issues
0 Accepted issues

Measures
0 Security Hotspots
80.6% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sonarqubecloud

sonarqubecloud Bot commented Sep 28, 2026

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@release-please release-please Bot mentioned this pull request Sep 30, 2026
chore(main): release 1.93.0 #14552
Merged
@whowes whowes mentioned this pull request Nov 10, 2026
refactor(gax): add ApiExceptionFactory overload accepting StatusCode.Code #14959
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@blakeli0 blakeli0 blakeli0 approved these changes
+1 more reviewer
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@whowes @blakeli0
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.