[MERGE][bug #153786] Partial fix for retrying if a pack file disappears
Martin Pool
mbp at canonical.com
Wed Oct 29 00:52:44 GMT 2008
On Wed, Oct 29, 2008 at 4:39 AM, John Arbash Meinel
<john at arbash-meinel.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Pool wrote:
>> Martin Pool has voted tweak.
>> Status is now: Conditionally approved
>> Comment:
>> Thanks for fixing this.
>>
>> I wonder if we should do something to prevent it looping indefinitely while
>> retrying, but that's probably unlikely and yagni; we can deal with it if it
>> arises.
>
> So the 'reload()' function returns False if reloading didn't actually
> find anything new, and I also explicitly tested the case of a file
> actually being gone and nothing we can do about it. So the code will try
> a reload, see it didn't get anything to work with, and raise the
> original exception.
>
> So *if* we had an extremely long running operation (say downloading all
> of mysql over a 9600 baud modem), and the repository was very active (it
> was a shared repo between all of mysql's developers). You certainly
> could end up hitting cases where you keep reloading the indexes.
> However, there are a few other things to consider:
Right, that's why I said yagni. :-)
> I changed it to:
> * The index logic is now able to reload the list of pack files if and
> index ends up disappearing. We still don't reload if the pack data
> itself goes missing after checking the index. This bug appears as a
> transient failure (file not found) when another process is writing
> to the repository. (John Arbash Meinel, #153786)
Sounds good.
> :param reload_func: A function to call if we find we are missing an
> index. Should have the form reload_func() => True if the list of
> active pack files has changed.
>
> ATM I also set True if the only change is a removal of a pack file.
> Which may actually be reasonable for "CombinedGraphIndex" since at that
> point the other indexes could be redundant and just not removed yet. (So
> we just want to skip what they might have contained.)
Good.
>> I would have put a guarded mutter statement here.
>>
>> --
>> Martin
>
> I'm not sure what you mean by "guarded" but I'm happy to log something.
'guarded' by an if statement, ie
if 'index' in debug.debug_flags:
mutter(...........)
--
Martin <http://launchpad.net/~mbp/>
More information about the bazaar
mailing list