GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(gax): enforce global timeout for resumable uploads by whowes · Pull Request #14425 · googleapis/google-cloud-java Conversation
|
|
/gemini review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.
1c271f8 to
864d8fd
Compare
864d8fd to
30e10f9
Compare
30e10f9 to
85c246b
Compare
| } | ||
|
|
||
| private void fail(Throwable t) { | ||
| ApiFuture<?> inFlight; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
There could be a race condition per AI:
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
There was an error while loading. Please reload this page.
| } else { | ||
| message = "Resumable upload timed out before session initiation completed"; | ||
| } | ||
| fail(new DeadlineExceededException(message, null, TIMEOUT_STATUS_CODE, false)); |
There was a problem 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.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
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.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.