Defect #7002
closedmysql timeout when first browsing a large git repository
0%
Description
This repository has 100000+ files,when firstly browsing it,the browser wait long time and show err:
'''
Internal error
An error occurred on the page you were trying to access.
If you continue to experience problems please contact your redMine administrator for assistance.
Back
'''
And the redmine log err:
'''
Processing RepositoriesController#show (for 10.125.25.55 at 2010-11-29 13:49:16) [GET]
Parameters: {"action"=>"show", "id"=>"android1", "controller"=>"repositories"}
ActiveRecord::StatementInvalid (Mysql::Error: Lock wait timeout exceeded; try restarting transaction: INSERT INTO `changesets` (`committed_on`, `comments`, `commit_date`, `scmid`, `user_id`, `revision`, `repository_id`, `committer`) VALUES('2010-11-25 14:27:10', 'init', '2010-11-25 14:27:10', '6c8534b1713a29cfcc2fdaa7faee604a81fdbbce', 16, '6c8534b1713a29cfcc2fdaa7faee604a81fdbbce', 9, 'zhang <zhang@mymail.com>')):
lib/redmine/scm/adapters/abstract_adapter.rb:298:in `save'
lib/redmine/scm/adapters/abstract_adapter.rb:289:in `save'
app/models/repository/git.rb:65:in `fetch_changesets'
app/models/repository/git.rb:65:in `each'
app/models/repository/git.rb:65:in `fetch_changesets'
app/controllers/repositories_controller.rb:77:in `show'
Rendering D:/webserver/Redmine/public/500.html (500 Internal Server Error)
'''
Related issues
Updated by Chunlin Zhang about 14 years ago
I have try several way to fix this.
At last,I found modify the git_adapter.rb @ 117 to
cmd = "#{GIT_BIN} --git-dir #{target('')} log --no-color --raw --date=iso --pretty=fuller --name-only "
Just add "--name-only",the repository page will get very fast!!
Updated by Toshi MARUYAMA almost 14 years ago
- Status changed from New to Closed
Please see http://www.redmine.org/projects/redmine/wiki/RedmineRepositories#Attaching-an-existing-repository-to-a-project .
Important: When you first browse the repository, Redmine retrieves the description of all of the existing commits and stores them in the database.
This is done only once per repository but can take a very long time (or even time out) if your repository has hundreds of commits.
To avoid this, you can do it offline.
After having your repository declared in Redmine, run the following command:
$ ruby script/runner "Repository.fetch_changesets" -e production
All commits will be retrieved in to the Redmine database.