[MERGE][bug #153786] Partial fix for retrying if a pack file disappears

John Arbash Meinel john at arbash-meinel.com
Thu Oct 23 22:13:54 BST 2008

Hash: SHA1

Attached is a partial fix for bug #153786. Basically, it changes the
CombinedGraphIndex layer so that it is able to tell the
RepositoryPackCollection to reload its list of pack files if we get a
NoSuchFile exception.

This is the easier part to fix, and I think it will end up handling 90%
of the times when someone encounters the bug. I wanted to put it up for
review early, just to make sure we felt it was a reasonable way to go.

The basic idea is that all CGI functions will trap NoSuchFile and issue
a reload of the pack names, and then try again. As most of these
functions are iterators, they will sometimes have already yielded
information from an index which no longer exists. For many cases, this
doesn't matter. (get_parent_map(), for example, doesn't care what index
it got the info from, as long as it got the info.)

The race condition which is left, is when we are trying to actually get
the content out of the repository. Consider "bzr log" when half-way
through the repo gets repacked. We'll have already worked out what .pack
files we want to read and where the data is inside them (having
consulted the index already) but when we issue a request for the data,
it will be missing.

I'll be working on that part next.

Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pack_retry_153786.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20081023/a5fa3da0/attachment-0001.diff 

More information about the bazaar mailing list