Archive for September, 2011

Vincent Ladeuil

The imports must go on !

The package importer is an important piece of the Ubuntu Distributed Development. It mirrors source packages and Bazaar branches and relies heavily on Launchpad to achieve that.

The past

During Launchpad downtimes, many (>1000) imports failed and they had to be re-queued semi-manually. The importer would have been better inspired by making tea instead of queuing imports that were bound to fail.

The circuit breaker

An automatically operated electrical switch designed to protect an electrical circuit <…> a circuit breaker can be reset (either manually or automatically) to resume normal operation.

This looks like a good candidate to avoid import failures while Launchpad is down.

In this automaton representing the behaviour of a circuit breaker, three events are used (remember that here closed == works ;)):

  • attempt: we try to use the circuit,
  • failure: an undesired event has occurred,
  • success: the circuit is working.

The main scenario here is:

closed — failure –> open — attempt –> half open — success –> closed

The reality test

A Launchpad rollout happened Friday 30 September 08:32. The importer log file said:

2011-09-30 08:32:02,308 – __main__ – INFO – Launchpad is down, re-trying jcifs

2011-09-30 08:34:09,337 – __main__ – INFO – Launchpad *is* back

The successful import took 27″, so the importer knew Launchpad was down for 1’40” (back – down – duration(import)). I asked the Launchpad admins how long it took them and their log said:

2011-09-30 08:33:41 INFO    Outage complete. 0:01:40.919527

Make tea… or not

Another interesting number here is that we retried 498 times during this downtime. This is probably excessive and can be fixed by reducing the importer concurrency while Launchpad is down. These 498 attempts were previously seen as failures for 498 different packages.

In the end, not only did we avoid these 498 spurious failures but the imports were only suspended for as long as Launchpad was down, up to the second !

But that’s a bit short to make tea…

Brian de Alwis

tiplog: record and reference the history of a branch’s tip

It’s sometimes useful to be able to revert a branch to a previous known state. For example, I recently updated a bzr plugin to its latest and greatest to discover a severe regression. If I had had some foresight, I might have recorded the revision (or the “tip”) before the update to allow me to rollback to the previous stable version. But as I rarely have such foresight, and have more important uses for my little grey cells, I set out to create ‘tiplog’, a new bzr plugin for recording and referencing the history of a branch’s tip.

‘tiplog’ is inspired by git’s ‘reflog’, and records commits, uncommits, pushes (to the branch), pulls (into the branch) — basically any change that causes the tip to change. ‘tiplog’ only records pushes to local branches. But the plugin can also be run within the smart server, although it cannot distinguish the causes of the tip change.

In my updating scenario described above, for example, say the plugin was at revision 20. Running ‘bzr pull‘ pulls in revision 40. ‘bzr tiplog‘ will inform me that my plugin was previously at r20:

$ bzr tiplog
2011-09-23 tip:0 40 bsd@mt.ca [pull] update version numbers
2011-08-25 tip:1 20 bsd@mt.ca [pull] fix bug #12009
2011-06-23 tip:2 1 bsd@mt.ca [pull] initial commit

Better yet, I can easily return to that previous stable revision using the new ‘tip:‘ revspec, with ‘bzr pull -r tip:1‘. ‘tip:0 is the current tip.

I also find tiplog useful when developing with others, as I can quickly review the changes since I last pulled:

$ bzr log --line -r tip:1..
17705: dev1@xxx.com 2011-09-27 fixes #1474
17704: dev2@xxx.com 2011-09-27 fixing Job Cost
17703: bsd@mt.ca 2011-09-25 fixes #1377

And in fact I have that bound to an alias.

To install tiplog, simply perform the following:

$ bzr branch lp:bzr-tiplog ~/.bazaar/plugins/tiplog

Please direct report any bugs or questions through the plugin’s Launchpad page.

Jonathan Riddell

qbzr with curves

Nice little visual change to qbzr, curves on the diff view..

Before:

After:

Thanks to Iwata Hidetaka.

Being bored of the IRC poll on blogs.kde.org I made a new poll for revision control systems. I’m glad to see that after one vote Bazaar is at 100%.

Jonathan Riddell

bzr starts speaking your language

Bug 83941 “bzr doesn’t speak my tongue” has been closed: bzr core can now be translated. (The qbzr and bzr-explorer guis have been internationalized for a couple of years.) If you want to help bring bzr to those who prefer to work in non-English languages please help translate at Launchpad.

The translation will involve quite a bit of specialist language (what is French for “colocated branch”?) and I expect there are strings yet that need to be added to the translation file. I also need to look at translations for plugins.  Please send issues to either the Bazaar mailing list or as bugs on bzr on Launchpad.

Philippe Lhoste wrote a while ago about the issues of translating DVCS terminology.