Commit e818988f authored by Stan Hu's avatar Stan Hu

Enable Google API retries for uploads

As stated in
https://github.com/googleapis/google-api-ruby-client#errors--retries,
enabling retries is strongly encouraged but disabled by default. Large
uploads that may hit timeouts will mainly benefit from this.

Note that this retry mechanism only kicks in if the HTTP command
encounters a server error, rate limit error, or transmission error.

This will help improve the reliability of backups and anything else that
goes through google-api-client. fog-google appears to be the main user
of this.

Closes https://gitlab.com/gitlab-org/gitlab/issues/23452
parent 131c34d1
---
title: Enable Google API retries for uploads
merge_request: 18040
author:
type: fixed
......@@ -10,6 +10,12 @@
#
require 'google/apis/container_v1beta1'
require 'google/apis/options'
# As stated in https://github.com/googleapis/google-api-ruby-client#errors--retries,
# enabling retries is strongly encouraged but disabled by default. Large uploads
# that may hit timeouts will mainly benefit from this.
Google::Apis::RequestOptions.default.retries = 3 if Gitlab::Utils.to_boolean(ENV.fetch('ENABLE_GOOGLE_API_RETRIES', true))
Google::Apis::ContainerV1beta1::AddonsConfig::Representation.tap do |representation|
representation.hash :cloud_run_config, as: 'cloudRunConfig'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment