google-cloud-java
google-cloud-java copied to clipboard
Socket read timeout is too short and there is no apparent way to override it
Is your feature request related to a problem? Please describe.
The "wait" call for long running operations is meant to block until either the operation completes or 2 minutes have passed. However, the default HTTP socket read timeout is only 20 seconds, so the wait call often fails with a socket read timeout, which also causes the need for more API calls, partially defeating the value of the wait call.
There does not appear to be any way to change the timeout. I see the HttpTransportOptions and ServiceOptions classes in java-core, but there doesn't appear to any way to configure those from the higher level, nor any code to make use of the transport options via a HttpRequestInitializer to cause those values to get set at the lower levels..
Describe the solution you'd like
- Provide a way to configure the socket timeouts
- This library should probaby configure a longer timeout by defaut in light of the wait operation.
Describe alternatives you've considered
Currently I'm catching the socket timeout and retrying as if it was a "not yet finished" return from the wait API as a workaround.
Additional context