我尝试了一下,无法解决当前的解决方案。当我访问显示问题的 GitLab 独角兽日志时,它就解决了:
I, [2014-02-10T17:46:29.953026 #5799] INFO -- : worker=0 ready
E, [2014-02-10T17:47:52.026874 #5719] ERROR -- : worker=1 PID:5728 timeout (181s > 180s), killing
E, [2014-02-10T17:47:52.039670 #5719] ERROR -- : reaped #<Process::Status: pid 5728 SIGKILL (signal 9)> worker=1
工作人员超时说明了 git clone 长时间运行的问题。
它已在 GitLab Unicorn 配置中修复。只需在 config/unicorn.rb 中将 180 秒更改为更大
timeout 360
如果您使用其他 Web 服务器或使用代理 Nginx,您可能还需要:
server {
...
# if a file, which is not found in the root folder is requested,
# then the proxy pass the request to the upsteam (gitlab unicorn)
location @gitlab {
proxy_read_timeout 600; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_connect_timeout 600; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://gitlab;
}
}
注意部分proxy_read_timeout和proxy_connect_timeout。