diff options
author | Stan Hu <stanhu@gmail.com> | 2018-01-08 22:24:03 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-01-08 22:24:03 +0000 |
commit | bd50ecbad8c00e7c9ab5c60fa8bc839a8905b4ab (patch) | |
tree | ef6f70f6c4563ee0fd227d245d5db84f0bd0b110 /lib | |
parent | cd16600eef48e697d737d92bdebf003b66af1426 (diff) | |
parent | 15ddfa2b5bd9f570cea4ddd2cf4a6db90c40b146 (diff) | |
download | gitlab-ce-bd50ecbad8c00e7c9ab5c60fa8bc839a8905b4ab.tar.gz |
Merge branch '41683-timeout-is-not-set-for-gitaly-fetch_remote-calls' into 'master'
Resolve "Timeout is not set for gitaly fetch_remote calls"
Closes #41683
See merge request gitlab-org/gitlab-ce!16245
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/gitaly_client/repository_service.rb | 7 | ||||
-rw-r--r-- | lib/gitlab/shell.rb | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/gitlab/gitaly_client/repository_service.rb b/lib/gitlab/gitaly_client/repository_service.rb index d43d80da960..66006f5dc5b 100644 --- a/lib/gitlab/gitaly_client/repository_service.rb +++ b/lib/gitlab/gitaly_client/repository_service.rb @@ -43,8 +43,11 @@ module Gitlab GitalyClient.call(@storage, :repository_service, :apply_gitattributes, request) end - def fetch_remote(remote, ssh_auth: nil, forced: false, no_tags: false) - request = Gitaly::FetchRemoteRequest.new(repository: @gitaly_repo, remote: remote, force: forced, no_tags: no_tags) + def fetch_remote(remote, ssh_auth:, forced:, no_tags:, timeout:) + request = Gitaly::FetchRemoteRequest.new( + repository: @gitaly_repo, remote: remote, force: forced, + no_tags: no_tags, timeout: timeout + ) if ssh_auth&.ssh_import? if ssh_auth.ssh_key_auth? && ssh_auth.ssh_private_key.present? diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb index 564047bbd34..a8a4ec996c4 100644 --- a/lib/gitlab/shell.rb +++ b/lib/gitlab/shell.rb @@ -128,7 +128,7 @@ module Gitlab def fetch_remote(repository, remote, ssh_auth: nil, forced: false, no_tags: false) gitaly_migrate(:fetch_remote) do |is_enabled| if is_enabled - repository.gitaly_repository_client.fetch_remote(remote, ssh_auth: ssh_auth, forced: forced, no_tags: no_tags) + repository.gitaly_repository_client.fetch_remote(remote, ssh_auth: ssh_auth, forced: forced, no_tags: no_tags, timeout: git_timeout) else storage_path = Gitlab.config.repositories.storages[repository.storage]["path"] local_fetch_remote(storage_path, repository.relative_path, remote, ssh_auth: ssh_auth, forced: forced, no_tags: no_tags) |