Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces ResumableUploadTransportValidator to validate transport configurations on StubSettings for resumable uploads, exposing helper methods via HttpJsonCallableFactory. A review comment suggests adding a defensive null check for the transport channel provider in ResumableUploadTransportValidator to prevent a potential NullPointerException.
9ef8b1e to
5ecea13
Compare
5ecea13 to
b7097e4
Compare
b7097e4 to
ea63e73
Compare
|
|
| // credentials, and endpoint configured on StubSettings. The provider is only compatible if it | ||
| // does not wrap a pre-built channel (FixedTransportChannelProvider) and still expects all | ||
| // three settings to be supplied by StubSettings. | ||
| return !(provider instanceof FixedTransportChannelProvider) |
There was a problem hiding this comment.
Discussed offline that this may introduce false positives. Because we are always creating a new channel from StubSettings, as long as customers set the same headers/credentials/endpoints on the StubSettings as well, resumable upload should be supported.
On the other hand, I don't think there is a concrete way to decide if a customized grpc channel can be supported for resumable uploads. This check still provide some value and can be used for a warning message instead of a hard failure.





gRPC clients bridge resumable uploads to HTTP/JSON using only top-level
StubSettings; pre-built channels or transport providers with direct endpoint, credentials, or header overrides are currently silently ignored rather than surfacing an actionable error.This PR adds
HttpJsonCallableFactory.isResumableUploadSupported()to detect incompatible transport providerscreateFailingResumableUploadCallable()that throws a deferred exception when an upload or resume call is invoked (stub initialization continues to be successful) if an incompatibility or error was encountered during stub creation.