Tweak to support really big merge requests
Created by: ayr-ton
Related to:
https://gitlab.com/gitlab-org/gitlab-ce/issues/295#note_160691
Fix based on Matthieu Vachon suggestion.
Created by: TeatroIO
I've prepared a stage. Click to open.
By Administrator on 2014-07-15T18:30:24 (imported from GitLab project)
1 1 module Gitlab 2 2 module Satellite 3 3 class Action 4 DEFAULT_OPTIONS = { git_timeout: 30.seconds } 4 DEFAULT_OPTIONS = { git_timeout: Gitlab.config.satellites.timeout.seconds } Created by: dzaporozhets
It mean if something bad happens - satellite will be blocked for 600 seconds (10mins). Nobody will be able to edit files or create merge requests. Another problem is that web server unicorn timeout still
30
seconds. So changing only this value does not help.If satellite cant collect diff in 30 seconds then it is something huge there. What sense to create MR for such big changes if you wont be able to review it anyway?
Thank you for PR but I dont think it makes sense to apply this patch
By Administrator on 2014-07-21T15:54:47 (imported from GitLab project)
1 1 module Gitlab 2 2 module Satellite 3 3 class Action 4 DEFAULT_OPTIONS = { git_timeout: 30.seconds } 4 DEFAULT_OPTIONS = { git_timeout: Gitlab.config.satellites.timeout.seconds } Created by: ayr-ton
@thiagozanetti If the merge request is too big, is needed to increase the timeout. The problem is, if we change the timeout in gitlab.yml, it doesn't change the timeout for satellites, that is what we use for store merge requests.
By Administrator on 2014-07-16T11:20:25 (imported from GitLab project)
1 1 module Gitlab 2 2 module Satellite 3 3 class Action 4 DEFAULT_OPTIONS = { git_timeout: 30.seconds } 4 DEFAULT_OPTIONS = { git_timeout: Gitlab.config.satellites.timeout.seconds } 1 1 module Gitlab 2 2 module Satellite 3 3 class Action 4 DEFAULT_OPTIONS = { git_timeout: 30.seconds } 4 DEFAULT_OPTIONS = { git_timeout: Gitlab.config.satellites.timeout.seconds } Created by: dzaporozhets
The problem is
timeout for git
!=timeout for satellite
.Satellite:
- lock satellite
- clone or fetch repo
- cleanup and prepare remotes/branches
- do git call (one or several)
- cleanup and release lock
As you see git call is only part of satellite. Having same value for satellite and git does not makes sense.
You can create separate config value for satellite timeout in this section if you want. But default value should be still 30 seconds because for most users bigger value does not makes sense.
By Administrator on 2014-07-21T15:54:47 (imported from GitLab project)
1 1 module Gitlab 2 2 module Satellite 3 3 class Action 4 DEFAULT_OPTIONS = { git_timeout: 30.seconds } 4 DEFAULT_OPTIONS = { git_timeout: Gitlab.config.satellites.timeout.seconds } 1 1 module Gitlab 2 2 module Satellite 3 3 class Action 4 DEFAULT_OPTIONS = { git_timeout: 30.seconds } 4 DEFAULT_OPTIONS = { git_timeout: Gitlab.config.satellites.timeout.seconds } 5 5 let(:user) { create(:user) } 6 6 7 7 describe '#prepare_satellite!' do 8 it 'should be able to fetch timeout from conf' do 5 5 let(:user) { create(:user) } 6 6 7 7 describe '#prepare_satellite!' do 8 it 'should be able to fetch timeout from conf' do 9 Gitlab.config.satellites.timeout = 30 10 DEFAULT_OPTIONS['git_timeout'].should == 30.seconds 1 1 module Gitlab 2 2 module Satellite 3 3 class Action 4 DEFAULT_OPTIONS = { git_timeout: 30.seconds } 4 DEFAULT_OPTIONS = { git_timeout: Gitlab.config.satellites.timeout.seconds } 141 141 142 142 Settings['satellites'] ||= Settingslogic.new({}) 143 143 Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root) 144 Settings.satellites['timeout'] ||= 30