Project

General

Profile

Actions

Defect #7002

closed

mysql timeout when first browsing a large git repository

Defect #7002: mysql timeout when first browsing a large git repository

Added by Chunlin Zhang almost 16 years ago. Updated almost 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Resolution:
Affected version:

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 <>')):
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 2 (1 open — 1 closed)

Related to Redmine - Defect #1931: Timeout risks: need asynchronous operationsNewActions
Related to Redmine - Defect #8143: Problem to update subtaskClosedActions

Updated by Chunlin Zhang almost 16 years ago Actions #1

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 16 years ago Actions #2

  • Category set to SCM

Updated by Toshi MARUYAMA almost 16 years ago Actions #3

  • 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.

Actions

Also available in: PDF Atom