Project

General

Profile

Actions

Defect #9472

closed

The git scm module causes an excess amount of DB traffic.

Added by John Kubiatowicz about 13 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
Start date:
2011-10-26
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

The fetch_changesets routine from the git scm module (app/model/repository/git.rb) executes a self.save after processing every change. This behavior causes the loading of large repositories to take a long time.

More importantly, this behavior cases problems with plugins that set up observers for the XXX_save events on the repository model (case in point: the redmine_git_hosting plugin). The result is that these callbacks are called far too frequently and end up taking so long that requests to view large repositories can time out and fail under the apache fcgi module.

One fix would be to wait until the very end of the routine to execute self.save. I've attached a proposed patch. With this patch, loading of repositories works much faster and do not timeout.

About your application's environment
Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.8.11
Rack version 1.1
Rails version 2.3.14
Active Record version 2.3.14
Active Resource version 2.3.14
Action Mailer version 2.3.14
Active Support version 2.3.14
Application root /source/quantum/redmine
Environment production
Database adapter mysql
Database schema version 20110928183125

About your Redmine plugins
Redmine Git Hosting Plugin 0.4.2
Redmine OpenID Selector plugin 0.0.1

Additionally, the redmine code was updated from the trunk this morning (svn ID 7654). Running under apache with the mod_fcgi.


Files

git.patch (947 Bytes) git.patch Proposed patch. John Kubiatowicz, 2011-10-26 08:03
git-1.png (22 KB) git-1.png Toshi MARUYAMA, 2011-10-28 00:26
git-2.png (19.8 KB) git-2.png Toshi MARUYAMA, 2011-10-28 00:26
git.odg (10.9 KB) git.odg Toshi MARUYAMA, 2011-10-28 00:26
git_brch_tx.patch (946 Bytes) git_brch_tx.patch Etienne Massip, 2011-10-28 12:20
git_brch_no_tx.patch (1.49 KB) git_brch_no_tx.patch Etienne Massip, 2011-10-28 12:30
git-branch.odg (10.8 KB) git-branch.odg Toshi MARUYAMA, 2011-10-28 14:32
git-branch.png (17.6 KB) git-branch.png Toshi MARUYAMA, 2011-10-28 14:32

Related issues

Related to Redmine - Defect #7146: Git adapter lost commits before 7 days from database latest changesetClosedToshi MARUYAMA2010-12-21

Actions
Related to Redmine - Defect #8857: Git: Too long in fetching repositories after upgrade from 1.1 or new branch at first timeClosedToshi MARUYAMA2011-07-20

Actions
Related to Redmine - Defect #6013: git tab,browsing, very slow -- even after first timeClosed2010-08-02

Actions
Actions

Also available in: Atom PDF