meld awfully slow opening Bazaar (bzr) repository

Bug #988296 reported by Per Ångström on 2012-04-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone
meld (Ubuntu)

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/
=== modified file 'meld/vc/'
--- meld/vc/ 2010-06-24 23:54:27 +0000
+++ meld/vc/ 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[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
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)

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.

[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]

Per Ångström (autark) wrote :

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.

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:

I can assist if you need help in doing so.

Changed in meld (Ubuntu):
status: New → Fix Released
Per Ångström (autark) wrote :

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

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 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) on 2012-04-26
description: updated
Per Ångström (autark) wrote :

OK, I have updated the bug description and created a packaging branch for natty:

I have not yet proposed for merging.

Per Ångström (autark) on 2012-04-26
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) on 2012-04-28
no longer affects: meld (Ubuntu Oneiric)
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

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

Thanks for your contribution.

Julian Taylor (jtaylor) wrote :

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

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.

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 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
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
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  Edit
Everyone can see this information.

Other bug subscribers