summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-07-24 13:40:35 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-07-24 13:56:28 +0200
commite77f46d1296de6720a44a12c68632efcf5e65a9a (patch)
treea1157f89b2fc0e211421a2575ea80a3692e89829
parent1c24eafb4106dc7890ef74093a59009e94baa705 (diff)
downloadgitlab-ce-e77f46d1296de6720a44a12c68632efcf5e65a9a.tar.gz
Remove timeouts for long running requests
-rw-r--r--changelogs/unreleased/zj-backup-timeout.yml5
-rw-r--r--lib/gitlab/gitaly_client.rb6
-rw-r--r--lib/gitlab/gitaly_client/repository_service.rb6
3 files changed, 13 insertions, 4 deletions
diff --git a/changelogs/unreleased/zj-backup-timeout.yml b/changelogs/unreleased/zj-backup-timeout.yml
new file mode 100644
index 00000000000..b2ad2ed8c63
--- /dev/null
+++ b/changelogs/unreleased/zj-backup-timeout.yml
@@ -0,0 +1,5 @@
+---
+title: Disable Gitaly timeouts when creating or restoring backups
+merge_request: 20810
+author:
+type: fixed
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index 58a4060cc96..c27972a84a4 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -407,7 +407,7 @@ module Gitlab
# The default timeout on all Gitaly calls
def self.default_timeout
- return 0 if Sidekiq.server?
+ return no_timeout if Sidekiq.server?
timeout(:gitaly_timeout_default)
end
@@ -420,6 +420,10 @@ module Gitlab
timeout(:gitaly_timeout_medium)
end
+ def self.no_timeout
+ 0
+ end
+
def self.timeout(timeout_name)
Gitlab::CurrentSettings.current_application_settings[timeout_name]
end
diff --git a/lib/gitlab/gitaly_client/repository_service.rb b/lib/gitlab/gitaly_client/repository_service.rb
index 64b9af4d70c..2956ed4b911 100644
--- a/lib/gitlab/gitaly_client/repository_service.rb
+++ b/lib/gitlab/gitaly_client/repository_service.rb
@@ -202,7 +202,7 @@ module Gitlab
save_path,
:create_bundle,
Gitaly::CreateBundleRequest,
- GitalyClient.default_timeout
+ GitalyClient.no_timeout
)
end
@@ -220,7 +220,7 @@ module Gitlab
bundle_path,
:create_repository_from_bundle,
Gitaly::CreateRepositoryFromBundleRequest,
- GitalyClient.default_timeout
+ GitalyClient.no_timeout
)
end
@@ -245,7 +245,7 @@ module Gitlab
:repository_service,
:create_repository_from_snapshot,
request,
- timeout: GitalyClient.default_timeout
+ timeout: GitalyClient.no_timeout
)
end