Merge branch '39977-gitlab-shell-default-timeout' into 'master'

Set the default gitlab-shell timeout to 3 hours

Closes #39977

See merge request gitlab-org/gitlab-ce!15292
This commit is contained in:
Douwe Maan 2017-11-21 19:08:09 +00:00
commit 04c438065c
5 changed files with 11 additions and 6 deletions

View file

@ -11,6 +11,7 @@
%li
If your HTTP repository is not publicly accessible, add authentication information to the URL: <code>https://username:password@gitlab.company.com/group/project.git</code>.
%li
The import will time out after 15 minutes. For repositories that take longer, use a clone/push combination.
The import will time out after #{time_interval_in_words(Gitlab.config.gitlab_shell.git_timeout)}.
For repositories that take longer, use a clone/push combination.
%li
To migrate an SVN repository, check out #{link_to "this document", help_page_path('user/project/import/svn')}.

View file

@ -0,0 +1,5 @@
---
title: Set the default gitlab-shell timeout to 3 hours
merge_request: 15292
author:
type: fixed

View file

@ -559,8 +559,8 @@ production: &base
upload_pack: true
receive_pack: true
# Git import/fetch timeout
# git_timeout: 800
# Git import/fetch timeout, in seconds. Defaults to 3 hours.
# git_timeout: 10800
# If you use non-standard ssh port you need to specify it
# ssh_port: 22

View file

@ -429,7 +429,7 @@ Settings.gitlab_shell['ssh_port'] ||= 22
Settings.gitlab_shell['ssh_user'] ||= Settings.gitlab.user
Settings.gitlab_shell['owner_group'] ||= Settings.gitlab.user
Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.__send__(:build_gitlab_shell_ssh_path_prefix)
Settings.gitlab_shell['git_timeout'] ||= 800
Settings.gitlab_shell['git_timeout'] ||= 10800
#
# Workhorse

View file

@ -101,8 +101,7 @@ module Gitlab
#
# Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/387
def import_repository(storage, name, url)
# Timeout should be less than 900 ideally, to prevent the memory killer
# to silently kill the process without knowing we are timing out here.
# The timeout ensures the subprocess won't hang forever
cmd = [gitlab_shell_projects_path, 'import-project',
storage, "#{name}.git", url, "#{Gitlab.config.gitlab_shell.git_timeout}"]
gitlab_shell_fast_execute_raise_error(cmd)