fog / fog-google

Fog for Google Cloud Platform
MIT License
99 stars 146 forks source link

Disable transfer timeout by default in storage request #560

Closed stanhu closed 2 years ago

stanhu commented 2 years ago

By default, httpclient will prevent any request from going longer than 120 seconds, which will cause any transfer to take longer than that to abort. As a result, the Google client will raise Google::Apis::TransmissionError: execution expired for any transfer that is longer than 2 minutes.

Google::Apis::RequestOptions.default.retries can be used to resume aborted uploads, but the default is set to 0. Plus, max_elapsed_time is set to 15 minutes by default, so this value would need to be raised as well. Support for this was added in https://github.com/googleapis/google-api-ruby-client/pull/8106, but this is a recent feature.

The main way we can fix this issue is to raise the timeout to a large value to disable it outright. Since httpclient uses Timeout::timeout, which can be dangerous, we disable this timeout by default if no send_timeout_sec is specified.

Closes https://github.com/fog/fog-google/issues/323

Temikus commented 2 years ago

@stanhu disabling timeouts are generally dangerous, what prevents someone from setting that timeout manually when they need to upload large files?

I feel I'm missing something here 🤔

github-actions[bot] commented 2 years ago

This pr has been marked inactive and will be closed if no further activity occurs.