[Yum-devel] [PATCH] honor retries config option at mirror group level rather than grabber level

Mike McLean mikem.rtp at gmail.com
Thu Jun 28 16:20:45 UTC 2012


On Thu, Jun 28, 2012 at 10:50 AM, Zdenek Pavlas <zpavlas at redhat.com> wrote:
>> +        cb_obj = (self._mirrorFailureHandler, ({},), {})
>>          self._grab = mgclass(self._grabfunc, urls,
>> -                             failure_callback=self.mirror_failure_obj)
>> +                             failure_callback=cb_obj)
>
> This runs once (for each repo) so the 'data' argument is shared.
>
>> +    def _mirrorFailureHandler(self, cb_obj, data):
>> +        tries = data.get(cb_obj.mirror, 0)
>> +        if self.retries and tries <= self.retries:
>> +            action['remove_master'] = action['remove'] = 0
>> +        data[cb_obj.mirror] = tries + 1
>> +        return action
>
> You'll retry each mirror configured number of times, but only
> for the 1st file requested.  Is that intentional?
> Anyway, I like the 'skip-but-retry' idea.

Ah, I see. My data dictionary is only getting defined once at the
start. I see a couple options:
1) pass this failure_callback as a kw arg to urlgrab instead
2) move this logic to MirrorGroup


More information about the Yum-devel mailing list