diff options
author | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-03-05 02:28:58 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-03-05 02:28:58 +0000 |
commit | d07b2e09fe3d930cc912ef17f6c499bdc58b7b97 (patch) | |
tree | c33f3e8f110b8e8aee324892895bf8e7fdfb103d /config | |
parent | 694ac54862d9b88ee0e82577d8fbf622534391bf (diff) | |
parent | 516bcabbf42d60db2ac989dce4c7187b2a1e5de9 (diff) | |
download | gitlab-ce-d07b2e09fe3d930cc912ef17f6c499bdc58b7b97.tar.gz |
Merge branch 'timeout' into 'master'
Increase timeout for Git-over-HTTP requests.
Fixes #2081 and https://gitlab.com/gitlab-org/gitlab-ce/issues/232.
Normal web requests are bound by the `Rack::Timeout` timeout of 60 seconds, while Grack Git-over-HTTP requests are only bound by Unicorn's timeout which is now set to 1 hour, which should be plenty.
The omnibus package should be updated to no longer use `unicorn['worker_timeout']` for the Unicorn timeout, but to set the `Slowpoke.timeout`.
See merge request !1619
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/timeout.rb | 8 | ||||
-rw-r--r-- | config/unicorn.rb.example | 20 |
2 files changed, 12 insertions, 16 deletions
diff --git a/config/initializers/timeout.rb b/config/initializers/timeout.rb new file mode 100644 index 00000000000..bc88595cf26 --- /dev/null +++ b/config/initializers/timeout.rb @@ -0,0 +1,8 @@ +# Slowpoke extends Rack::Timeout to gracefully kill Unicorn workers so they can clean up state. +Slowpoke.timeout = 60 + +# The `Rack::Timeout` middleware kills requests after 60 seconds (as set above). +# We're replacing it with our `Gitlab::Middleware::Timeout` that does the same, +# except ignoring Git-over-HTTP requests, letting those take as long as they need. + +Rails.application.config.middleware.swap(Rack::Timeout, Gitlab::Middleware::Timeout) diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example index d8b4f5c7c32..29253b71f49 100644 --- a/config/unicorn.rb.example +++ b/config/unicorn.rb.example @@ -35,22 +35,10 @@ working_directory "/home/git/gitlab" # available in 0.94.0+ listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 1024 listen "127.0.0.1:8080", :tcp_nopush => true -# nuke workers after 30 seconds instead of 60 seconds (the default) -# -# NOTICE: git push over http depends on this value. -# If you want be able to push huge amount of data to git repository over http -# you will have to increase this value too. -# -# Example of output if you try to push 1GB repo to GitLab over http. -# -> git push http://gitlab.... master -# -# error: RPC failed; result=18, HTTP code = 200 -# fatal: The remote end hung up unexpectedly -# fatal: The remote end hung up unexpectedly -# -# For more information see http://stackoverflow.com/a/21682112/752049 -# -timeout 60 +# Kill workers after 1 hour. +# A shorter timeout of 60 seconds is enforced by rack-timeout for web requests. +# Git-over-HTTP only has the below timeout since large pulls/pushes can take a long time. +timeout 60 * 60 # feel free to point this anywhere accessible on the filesystem pid "/home/git/gitlab/tmp/pids/unicorn.pid" |