Thanks, setting dom=None solved the problem. But that needs to make alot of changes in the code. Do we have any other alternative ?<div><br></div><div>--</div><div>Jatin<br><br><div class="gmail_quote">On Thu, Jan 12, 2012 at 3:46 PM, Daniel P. Berrange <span dir="ltr"><<a href="mailto:berrange@redhat.com">berrange@redhat.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">On Thu, Jan 12, 2012 at 10:10:47AM +0100, Michal Privoznik wrote:<br>
> On 11.01.2012 19:14, Jatin Kumar wrote:<br>
> > Hello,<br>
> > I was getting the following error in syslog:<br>
> > libvirtd: 21:19:12.116: 10955: error : qemudDispatchServer:1355 : Too<br>
> > many active clients (20), dropping connection from 127.0.0.1;0<br>
> ><br>
> > I investigated a bit and tried the following in a python console:<br>
> ><br>
> > import libvirt<br>
> > ~~~~<br>
> > conn=libvirt.openReadOnly("qemu+ssh://HOST_IP/system<br>
> > <<a href="http://10.16.71.1/system" target="_blank">http://10.16.71.1/system</a>>")<br>
> > //now check the no. of connections (by lsof|grep ESTABLISHED in the<br>
> > HOST), the count will increase by 1<br>
> > conn.close()<br>
> > *//the count will decrease by 1, it returns 0*<br>
> > ~~~~<br>
> > conn=libvirt.openReadOnly("qemu+ssh://HOST_IP/system<br>
> > <<a href="http://10.16.71.1/system" target="_blank">http://10.16.71.1/system</a>>")<br>
> > //now check the no. of connections, the count will increase by 1<br>
> > dom=conn.lookupByName("sowmya")<br>
> > print <a href="http://dom.info" target="_blank">dom.info</a> <<a href="http://dom.info/" target="_blank">http://dom.info/</a>>()<br>
> > conn.close()<br>
> > *//the count will not change, it returns 1*<br>
> > *<br>
> > *<br>
> > This is creating a lot of trouble to me but the reason is unknown.<br>
> > If someone could please point me out, if i am missing something.<br>
> > --<br>
> > Jatin<br>
><br>
> conn.close() returns the number of references to connection object;<br>
> So if the latter example returns 1 it is right as you still have domain<br>
> object which you obtained via lookupByName(). So you need to destroy<br>
> that object prior to closing connection.<br>
<br>
</div></div>It is probably sufficient to just do<br>
<br>
   dom = None<br>
<br>
to force immediate garbage collection of the 'dom' object<br>
<br>
Daniel<br>
<font color="#888888">--<br>
|: <a href="http://berrange.com" target="_blank">http://berrange.com</a>      -o-    <a href="http://www.flickr.com/photos/dberrange/" target="_blank">http://www.flickr.com/photos/dberrange/</a> :|<br>
|: <a href="http://libvirt.org" target="_blank">http://libvirt.org</a>              -o-             <a href="http://virt-manager.org" target="_blank">http://virt-manager.org</a> :|<br>
|: <a href="http://autobuild.org" target="_blank">http://autobuild.org</a>       -o-         <a href="http://search.cpan.org/~danberr/" target="_blank">http://search.cpan.org/~danberr/</a> :|<br>
|: <a href="http://entangle-photo.org" target="_blank">http://entangle-photo.org</a>       -o-       <a href="http://live.gnome.org/gtk-vnc" target="_blank">http://live.gnome.org/gtk-vnc</a> :|<br>
<br>
</font></blockquote></div><br></div>