Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers/google_api_client.rb')
-rw-r--r--config/initializers/google_api_client.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/config/initializers/google_api_client.rb b/config/initializers/google_api_client.rb
index ab469e5b0a1..9c1bc3ca783 100644
--- a/config/initializers/google_api_client.rb
+++ b/config/initializers/google_api_client.rb
@@ -11,13 +11,7 @@ require 'signet/errors'
# 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))
-# By default, httpclient will set a send timeout of 120 seconds (https://github.com/nahi/httpclient/blob/82929c4baae14c2319c3f9aba49488c6f6def875/lib/httpclient/session.rb#L147),
-# which causes any request to be interrupted every 2 minutes (https://github.com/nahi/httpclient/blob/82929c4baae14c2319c3f9aba49488c6f6def875/lib/httpclient/session.rb#L515).
-#
-# The Google API client uses resumable uploads so that if a transfer
-# request is interrupted, it can retry where it left off. The client
-# will retry at most N + 1 times, which means transfers can only last as
-# long as this (N + 1) * send timeout. We raise this timeout to an hour
-# since otherwise transfers can only last 8 minutes (4 * 2 min) before
-# being interrupted.
-Google::Apis::ClientOptions.default.send_timeout_sec = 3600
+# The default chunk size of 100MB provides no performance benefits
+# while using more memory at peak, see discussion in
+# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108456#note_1259008557
+Google::Apis::RequestOptions.default.upload_chunk_size = 10.megabytes