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): replace InputStream with InputStreamSupplier in resumable upload public surfaces by whowes · Pull Request #14521 · googleapis/google-cloud-java

Conversation

@whowes

@whowes whowes commented Sep 26, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Switches resumable upload client library and Callable methods to use the newly-introduced InputStreamSupplier in place of direct InputStream instances.

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]
gemini-code-assist Bot reviewed Sep 26, 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 replaces the direct use of InputStream with a new functional interface InputStreamSupplier in the resumable upload API, allowing the payload stream to be opened lazily and managed automatically. The review feedback recommends catching Exception instead of Throwable when invoking the payload supplier in ResumableUploadCallableImpl to avoid swallowing critical JVM errors.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread ...form-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResumableUploadCallableImpl.java Outdated
Comment on lines +118 to +127
try {
payloadStream = checkNotNull(payload.get(), "payload supplier returned null");
} catch (Throwable t) {
// Skip session initiation and fail the upload through the standard start-failure path. An
// empty placeholder stream stands in for the payload that could not be obtained.
return createFuture(
ApiFutures.immediateFailedFuture(t),
new ByteArrayInputStream(new byte[0]),
effectiveSettings);
}

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

medium

Catching Throwable is generally discouraged because it catches serious JVM errors (such as OutOfMemoryError or StackOverflowError) that the application should not attempt to handle or swallow. It is safer to catch Exception instead, which will still cover all checked and unchecked exceptions thrown by payload.get().

Suggested change
try {
payloadStream = checkNotNull(payload.get(), "payload supplier returned null");
} catch (Throwable t) {
// Skip session initiation and fail the upload through the standard start-failure path. An
// empty placeholder stream stands in for the payload that could not be obtained.
return createFuture(
ApiFutures.immediateFailedFuture(t),
new ByteArrayInputStream(new byte[0]),
effectiveSettings);
}
InputStream payloadStream;
try {
payloadStream = checkNotNull(payload.get(), "payload supplier returned null");
} catch (Exception e) {
// Skip session initiation and fail the upload through the standard start-failure path. An
// empty placeholder stream stands in for the payload that could not be obtained.
return createFuture(
ApiFutures.immediateFailedFuture(e),
new ByteArrayInputStream(new byte[0]),
effectiveSettings);
}

Sorry, something went wrong.

Uh oh!

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

All reactions
@whowes
whowes force-pushed the whowes/resumable-upload-supplier branch 3 times, most recently from 483c740 to 063f73c Compare September 26, 2026 03:43
@whowes whowes changed the title feat(gax): accept InputStreamSupplier for resumable upload payloads feat(gax): replace InputStream with InputStreamSupplier in resumable upload public surfaces Sep 26, 2026
@whowes
whowes added this pull request to stack #14476 September 26, 2026 04:24
@whowes
whowes force-pushed the whowes/resumable-upload-supplier branch from 063f73c to 9f1aaf6 Compare September 28, 2026 17:57
blakeli0
blakeli0 reviewed Sep 28, 2026
View reviewed changes
Comment thread sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/InputStreamSupplier.java
public interface InputStreamSupplier {

/**
* Opens or returns the {@link InputStream} to be read.

@blakeli0 blakeli0 Sep 28, 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.

nit: Add a comment mentioning that the stream will be managed/closed when the resumable upload is completed/failed/cancelled.

Sorry, something went wrong.

Uh oh!

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

All reactions

@whowes whowes Sep 29, 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 approved these changes Sep 28, 2026
View reviewed changes
@whowes
whowes force-pushed the whowes/resumable-upload-supplier branch 3 times, most recently from f12ccca to 50df8b5 Compare September 28, 2026 20:49
@whowes
whowes force-pushed the whowes/resumable-upload-supplier branch from 50df8b5 to 7ff4352 Compare September 29, 2026 00:14
@sonarqubecloud

sonarqubecloud Bot commented Sep 29, 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%)
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

All reactions

Sorry, something went wrong.

Uh oh!

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

@whowes
whowes force-pushed the whowes/resumable-upload-supplier branch from 7ff4352 to 3a69aec Compare September 29, 2026 00:47
@whowes
whowes force-pushed the whowes/resumable-upload-supplier branch from 3a69aec to de739ae Compare September 29, 2026 00:52
@whowes
whowes marked this pull request as ready for review September 29, 2026 01:03
@whowes
whowes requested review from a team as code owners September 29, 2026 01:03
@whowes
whowes force-pushed the whowes/resumable-upload-supplier branch from de739ae to d3d5e6c Compare September 29, 2026 02:05
@whowes
whowes force-pushed the whowes/resumable-upload-supplier branch 3 times, most recently from 5710846 to 4ec9559 Compare September 29, 2026 06:07
Base automatically changed from whowes/showcase-progress-it to main September 29, 2026 06:27
@whowes
feat(gax): accept InputStreamSupplier for resumable upload payloads
6168784
@whowes
whowes force-pushed the whowes/resumable-upload-supplier branch from 4ec9559 to 6168784 Compare September 29, 2026 06:27
@sonarqubecloud

sonarqubecloud Bot commented Sep 29, 2026

Copy link
Copy Markdown

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

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

All reactions

Sorry, something went wrong.

Uh oh!

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

@sonarqubecloud

sonarqubecloud Bot commented Sep 29, 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%)
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

All reactions

Sorry, something went wrong.

Uh oh!

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

@whowes
whowes merged commit 3c79730 into main Sep 29, 2026
293 of 304 checks passed

Uh oh!

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

@whowes
whowes deleted the whowes/resumable-upload-supplier branch September 29, 2026 06:59
@release-please release-please Bot mentioned this pull request Sep 30, 2026
chore(main): release 1.93.0 #14552
Merged
blakeli0 pushed a commit that referenced this pull request Sep 30, 2026
@release-please
chore(main): release 1.93.0 (#14552)
976d588
🤖 I have created a release *beep* *boop*
---


<details><summary>1.93.0</summary>

##
[1.93.0](v1.92.0...v1.93.0)
(2026-09-30)


### ⚠ BREAKING CHANGES

* **automl:** remove java-automl library
([#14540](#14540))

### Features

* **automl:** remove java-automl library
([#14540](#14540))
([6f13a1d](6f13a1d))
* **bigquery-jdbc:** infer undeclared fields in PreparedStatement
([#14400](#14400))
([e989a72](e989a72))
* **gax,gapic-generator-java:** retry start upload call and rename
ResumableUploadCallSettings to ResumableUploadOptions
([#14511](#14511))
([98c2073](98c2073))
* **gax:** add chunk upload recovery loop for resumable uploads
([#14424](#14424))
([8ecd1e5](8ecd1e5))
* **gax:** add ResumableUploadProgressListener and related
infrastructure
([#14426](#14426))
([c7f10d8](c7f10d8))
* **gax:** add RewindableStreamBuffer in prep for chunk upload recovery
([#14423](#14423))
([349c315](349c315))
* **gax:** enforce global timeout for resumable uploads
([#14425](#14425))
([3cb9805](3cb9805))
* **gax:** include upload-status header in resumable upload command
response objects
([#14420](#14420))
([23e49c1](23e49c1))
* **gax:** replace InputStream with InputStreamSupplier in resumable
upload public surfaces
([#14521](#14521))
([3c79730](3c79730))
* **gax:** retry chunk upload on transient errors
([#14422](#14422))
([e72365e](e72365e))
* **gax:** treat resumable upload server rejection as terminal
([#14516](#14516))
([b288788](b288788))
* **gax:** wire up ResumableUploadProgressTracker
([#14427](#14427))
([e7ba3e8](e7ba3e8))
* **grpc-gcp:** Add shared fallback state and probing recovery options
to GcpFallbackChannel
([#14013](#14013))
([675f639](675f639))
* **pubsub:** add publish start time to client telemetry header
([#14496](#14496))
([4b6a671](4b6a671))


### Bug Fixes

* **auth:** exclude javax.annotation-api from api-common dependency
([#14538](#14538))
([668fd18](668fd18)),
refs
[#12363](#12363)
* **bigquery-jdbc:** abort session when connection is closed
([#14273](#14273))
([5bd4520](5bd4520)),
refs
[#13922](#13922)
* **storage:** add App Hub storage.googleapis.com prefix to
destination.id
([#14527](#14527))
([0f6f9b5](0f6f9b5))


### Documentation

* Add gRPC Post-Quantum Cryptography Guide
([#14245](#14245))
([340a239](340a239))
* **samples:** add zonal bucket pre-warmed writer pool sample
([#14517](#14517))
([32e6f87](32e6f87))
* **samples:** pre-warm writer pool channels with flush() after open()
([#14537](#14537))
([df06290](df06290))
* update PQC guide to follow standard template format
([#14333](#14333))
([0b969d5](0b969d5))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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.