meld awfully slow opening Bazaar (bzr) repository

Bug #988296 reported by Per Ångström
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
meld (Ubuntu)
Fix Released
Low
Unassigned
Natty
Fix Released
Undecided
Unassigned

Bug Description

After upgrading from Ubuntu 10.10 to 11.04 I'm having trouble running meld on some Bazaar (bzr) repositories: meld seems to freeze up while bzr runs at 100 % CPU until I kill it. After some digging I have found that it's the invocation of "brz check" that seemingly runs into an endless loop:

/home/project/autarkse/trunk$ bzr check
Checking working tree at '/home/project/autarkse/trunk'.
Checking branch at 'file:///home/project/autarkse/branches/V4_0_31_patch/'.
Checking branch at 'file:///home/project/autarkse/branches/before-removing-html-files/'.
Checking branch at 'file:///home/project/autarkse/branches/before_ui_change/'.
Checking branch at 'file:///home/project/autarkse/branches/initial0/'.
Checking branch at 'file:///home/project/autarkse/branches/new-ui-branch/'.
Checking branch at 'file:///home/project/autarkse/trunk/'.
Checking repository at 'file:///home/project/autarkse/'.
\ checking commit contents:inventories 0/2
bzr: interrupted

However, if I am really patient, bzr will run to an end, and I can start working, but on this particular repository it takes some 3 to 4 minutes with the CPU running hot, and that's every time I open meld on this repository!

Apparently, the invocation of "bzr check" was added in revision 24:
$ bzr diff -r23..24 meld/vc/bzr.py
=== modified file 'meld/vc/bzr.py'
--- meld/vc/bzr.py 2010-06-24 23:54:27 +0000
+++ meld/vc/bzr.py 2010-09-28 14:29:19 +0000
@@ -57,6 +57,11 @@
         return [self.CMD] + self.CMDARGS + ["revert"]
     def resolved_command(self):
         return [self.CMD] + self.CMDARGS + ["resolve"]
+ def valid_repo(self):
+ if _vc.call([self.CMD, "check"]):
+ return False
+ else:
+ return True
     def get_working_directory(self, workdir):
         return self.root

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: meld 1.5.0-0ubuntu1.1
ProcVersionSignature: Ubuntu 2.6.38-14.58-generic 2.6.38.8
Uname: Linux 2.6.38-14-generic x86_64
Architecture: amd64
Date: Wed Apr 25 14:31:29 2012
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
PackageArchitecture: all
SourcePackage: meld
UpgradeStatus: Upgraded to natty on 2012-04-23 (2 days ago)

[Impact]
First of all, the bug is limited to Bazaar repositories. Secondly, the degree of impact depends on repository size and complexity: On a large and complex repository the bug can add minutes to meld startup time, during which time meld is completely unresponsive, while even on a small repository, "bzr check" is a lot slower than "bzr status", which impacts unfavorably on meld startup time.
[/Impact]

[Development Fix]
In the development branch, the bug has been implicitly fixed by fetching a later release from upstream, where the invocation of "bzr check" has been changed to "bzr status".
[/Development Fix]

[Stable Fix]
A minimal stable fix is to back-port the development fix in isolation.
[/Stable Fix]

[Test Case]
1) Navigate to a Bazaar repository, where the invocation of "bzr check" takes more than a few seconds' time.
2) Open meld on this repository.
Expected behavior: Meld opens quickly with the repository loaded.
Actual behavior: Meld opens with the UI frozen until the "bzr check" command has run to finish.
[/Test Case]

[Regression Potential]
The regression potential is deemed to be minimal. In essence, the fix means that "bzr status" will be used instead of "bzr check" to implement the method valid_repo. As long as the return value of "bzr status" reflects the basic validity of a Bazaar repository, there should be no regression potential
[/Regression Potential]

Revision history for this message
Per Ångström (autark) wrote :
Revision history for this message
Per Ångström (autark) wrote : Re: [Bug 988296]

I find that this is fixed in revision 29 (current trunk); it uses "bzr
status" instead of "bzr check" to check for a valid repo.

Revision history for this message
Julian Taylor (jtaylor) wrote : Re: bzr check awfully slow checking repository in valid_repo

I'm guessing with revision 29 you mean the packaging branch, meld itself uses git.
So this is fixed in ubuntu precise.

If you want you can create a packaging patch for natty and oneiric, please follow this procedure:
https://wiki.ubuntu.com/StableReleaseUpdates

I can assist if you need help in doing so.

Changed in meld (Ubuntu):
status: New → Fix Released
Revision history for this message
Per Ångström (autark) wrote :

Adding a minimal patch to solve this bug for natty, taken from precise.

Revision history for this message
Julian Taylor (jtaylor) wrote :

it would need to be a patch to the package and the bug description needs to be filed out appropriately.
I consider it low importance as it only affects bzr on larger repositories and can be worked around.

Please see https://wiki.ubuntu.com/PackagingGuide/Recipes for some guides on how to create a package branch, recipe 2 and 5 should be helpful.

Changed in meld (Ubuntu):
importance: Undecided → Low
Per Ångström (autark)
description: updated
Revision history for this message
Per Ångström (autark) wrote :

OK, I have updated the bug description and created a packaging branch for natty:
lp:~autark/ubuntu/natty/meld/meld-fix-988296

I have not yet proposed for merging.

Per Ångström (autark)
description: updated
summary: - bzr check awfully slow checking repository in valid_repo
+ meld awfully slow opening Bazaar (bzr) repository in valid_repo
summary: - meld awfully slow opening Bazaar (bzr) repository in valid_repo
+ meld awfully slow opening Bazaar (bzr) repository
Julian Taylor (jtaylor)
no longer affects: meld (Ubuntu Oneiric)
Revision history for this message
Julian Taylor (jtaylor) wrote :

some small issues with your branch:
- typo: natty-propsed -> natty-proposed
- the patch needs to be added to debian/patches/series to be applied at build time
- the original source should stay unmodified so the patch applies with quilt push, or add the quilt files to the branch so it can be removed again with quilt pop
- the patch should be a -p1 patch, that is the files have a prepending directory.

I renamed the patch to fix-slow-bzr-start.patch so its clearer what it does and added an Origin: tag according to http://dep.debian.net/deps/dep3/

I fixed the issues and uploaded it to -proposed, please test it when the release team accepts the upload.

Thanks for your contribution.

Revision history for this message
Julian Taylor (jtaylor) wrote :

the issue is already fixed in oneiric, my initial comment about it was wrong.

Revision history for this message
Per Ångström (autark) wrote :

Thank you, Julian, for your assistance!

> I fixed the issues and uploaded it to -proposed, please test it when the release team accepts the upload.

I suppose I'll be notified by the system when that happens.

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Per, or anyone else affected,

Accepted meld into natty-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in meld (Ubuntu Natty):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Per Ångström (autark) wrote :

Hello Martin and Julian,

I have installed and tested the newly-built package from natty-proposed, and I have verified that meld does no longer stall on the repositories that caused me to open this bug report. I also have verified the basic bzr functionality, including diff, commit and revert.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package meld - 1.5.0-0ubuntu1.2

---------------
meld (1.5.0-0ubuntu1.2) natty-proposed; urgency=low

  * debian/patches/fix-slow-bzr-start.patch (LP: #988296)
    - Fix slow meld startup on opening complex Bazaar repositories
 -- pang <email address hidden> Thu, 26 Apr 2012 10:56:37 +0200

Changed in meld (Ubuntu Natty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.