List Info

Thread: Lazy initialization of mirror lists




Lazy initialization of mirror lists
user name
2007-04-15 12:00:28
Hi all:

The attached patch makes urls, grab, and grabfunc lazily
initialized
properties on YumRepository. The benefit is that if your
repos are using
mirrorlists, then you only have to fetch the mirrorlists
from the server
if you are doing any operations that will need the network.
Previously
yum would always grab the mirrorlists, in many cases
resulting in
unneeded http connections.

Anyone see any cases where this will break stuff?

-James

_______________________________________________
Yum-devel mailing list
Yum-devellinux.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

  
Re: Lazy initialization of mirror lists
user name
2007-04-15 14:48:58

James Bowes wrote:
> Anyone see any cases where this will break stuff?

It breaks everything right now. self.grabfunc = ... in
_setupGrab should
be self._grabfunc

oops.

-James


_______________________________________________
Yum-devel mailing list
Yum-devellinux.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Re: Lazy initialization of mirror lists
user name
2007-04-15 17:06:25

James Bowes wrote:
> It breaks everything right now. self.grabfunc = ... in
_setupGrab should
> be self._grabfunc

It also didn't set up the callbacks properly.
Attached is a more working version.

-James

_______________________________________________
Yum-devel mailing list
Yum-devellinux.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

  
Re: Lazy initialization of mirror lists
country flaguser name
United States
2007-04-16 02:22:39
James Bowes wrote:
redhat.com" type="cite">
James Bowes wrote:
  
It breaks everything right now. self.grabfunc = ... in _setupGrab should
be self._grabfunc
    

It also didn't set up the callbacks properly.

Attached is a more working version.

-James
  
+    urls = property(lambda self: self._geturls())
 
  
I think it will be a good idea to 'fset' and 'fdel' funtions to the urls property so it can be urls get be reset and overwritten by plugins and API programs.

Tim
Re: Lazy initialization of mirror lists
country flaguser name
United States
2007-04-16 07:43:08
On Sun, Apr 15, 2007 at 06:06:25PM -0400, James Bowes
wrote:
> 
> 
> James Bowes wrote:
> > It breaks everything right now. self.grabfunc =
... in _setupGrab should
> > be self._grabfunc
> 
> It also didn't set up the callbacks properly.
> Attached is a more working version.

How would this affect my dellsysidplugin found in the
firmware-addon-dell RPM? I had to manually re-process
mirrorlist
variable because it was processed earlier than my plugin
hook could get
to the yumvars.

I sent a note to the list last week asking for
a hook to modify yumvars before they are used. It seems that
this would
probably be a good opportunity to add this.
--
Michael
_______________________________________________
Yum-devel mailing list
Yum-devellinux.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Re: Lazy initialization of mirror lists
user name
2007-04-16 09:32:04
Tim Lauridsen wrote:
> I think it will be a good idea to 'fset' and 'fdel'
funtions to the urls
> property so it can be urls get be reset and overwritten
by plugins and
> API programs.

Yeah, I suppose so, since it could be done before. Thanks
Tim.

-James


_______________________________________________
Yum-devel mailing list
Yum-devellinux.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Re: Lazy initialization of mirror lists
user name
2007-04-16 10:08:55
Michael E Brown wrote:
> How would this affect my dellsysidplugin found in the
> firmware-addon-dell RPM? I had to manually re-process
mirrorlist

I took a quick look at your plugin, and I don't think it
will affect it.
The changes I proposed would alter the behaviour after
init_hook runs.

-James


_______________________________________________
Yum-devel mailing list
Yum-devellinux.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Re: Lazy initialization of mirror lists
country flaguser name
United States
2007-04-16 10:12:17
On Mon, Apr 16, 2007 at 11:08:55AM -0400, James Bowes
wrote:
> Michael E Brown wrote:
> > How would this affect my dellsysidplugin found in
the
> > firmware-addon-dell RPM? I had to manually
re-process mirrorlist
> 
> I took a quick look at your plugin, and I don't think
it will affect it.
> The changes I proposed would alter the behaviour after
init_hook runs.

Ok. My plugin has to manually munge the .mirrorlist variable
contents in
the init_hook plugin. I was just concerned that if this
variable is
changed, I would have to change my plugin. (No, I hadnt
looked at the
patch yet... also wanted to plug the idea of having a
yumvars hook again
since I had not gotten a response on the proposal.)

--
Michael
_______________________________________________
Yum-devel mailing list
Yum-devellinux.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Re: Lazy initialization of mirror lists
user name
2007-04-16 11:59:21
On Sun, 2007-04-15 at 13:00 -0400, James Bowes wrote:
> The attached patch makes urls, grab, and grabfunc
lazily initialized
> properties on YumRepository. The benefit is that if
your repos are using
> mirrorlists, then you only have to fetch the
mirrorlists from the server
> if you are doing any operations that will need the
network. Previously
> yum would always grab the mirrorlists, in many cases
resulting in
> unneeded http connections.
> 
> Anyone see any cases where this will break stuff?

The main reason I'd see it breaking is where people expect
that the
mirrorlist has already been grabbed.

That said, it's probably okay... it just does have the
chance of causing
subtle weirdness for people.

Jeremy

_______________________________________________
Yum-devel mailing list
Yum-devellinux.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

[1-9]

about | contact  Other archives ( Real Estate discussion Medical topics )