[Catalog-sig] Mirror list detection/construction - PEP 381

P.J. Eby pje at telecommunity.com
Thu Jul 22 03:55:49 CEST 2010


At 02:52 AM 7/22/2010 +0200, Jesus Cea wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>On 21/07/10 21:20, P.J. Eby wrote:
> > At 01:10 PM 7/21/2010 +0100, Paul Nasrat wrote:
> >> Given the fragility of this it seems that we might want to consider
> >> alternative mirrorlist discovery mechanism.
> >
> > As a fallback, you can of course probe addresses on a binary search, or
> > even just select a random mirror in the first place.  (If you overshoot
> > the list, you just decrease the max on your binary lookup.)
> >
> > Non-random selection is tougher to implement, since you'd need to keep
> > some kind of history to make it work effectively.  Determining the
> > length of the list is a trivial problem by comparison.
>
>Well a random shuffle is a standard operation in "random" module :-).
>
>What I usually do is to pick a random server and my previous selection
>(the first time, you choose a second random server). Then do some
>operations in BOTH and choose the faster. Complete the operation on it
>and keep it for the next time.
>
>This way you always go the fast route, but randomly and gently probe
>other nodes trying to find even other faster.

Not a bad idea.  My main sticking point for adding this to 
easy_install is that it doesn't currently maintain any state like 
this, and there's no obvious place to put it.  Silently rewriting 
config files would be evil, and given that distutils has three layers 
of config files, it's never really clear which one you'd want to 
write to anyway.  Most likely, I'll need to just use "try the default 
or specified one first, then fall back to randomly-selected mirrors.



More information about the Catalog-SIG mailing list