[execnet-dev] Close remote gateway?

Charles Solar charlessolar at gmail.com
Tue Jun 15 21:35:42 CEST 2010


Thanks for the pointers.  execnet.gateway does not have a close method, but
I assume you mean exit because it does have that.
Unfortunately after testing it out the last couple of days this method does
not do what I want either.  It just orphans the remote processes and they
eventually get cleaned up 5-10 seconds later by the os.

As a result of further testing I am now planning on shifting my design away
from many python interpreters in favor one interpreter per remote machine so
this is not really a problem anymore for me.  However it would still be nice
to be able to call exit on a remote gateway and have it close immediately.

Also I have been referring to pytest-xdist for some things, but the way I
need to test my app requires a different sort of framework capable of
handling tests that communicate with other machines.  xdist only handles
running unit tests on other machines in a closed environment.

Thanks

On Sat, Jun 12, 2010 at 7:54 AM, Ronny Pfannschmidt <
Ronny.Pfannschmidt at gmx.de> wrote:

> On Fri, 2010-06-11 at 15:42 -0500, Charles Solar wrote:
> > I am attempting to use execnet to start remote python sessions for a
> > testing framework I am working on.  This framework will spawn a lot of
> > remote gateways since I want each test to be run on its own process, a
> > simpler and more clean approach imo.
> >
> you might want to take a look into py.test's forked test execution
> (the --boxed param) and the pytest-xdist plugin for inspiration
> (or even a reason to contribute to pytest instead of making a own
> framework >:-) )
>
> > Things work great for the first few tests but I have been noticing
> > that python interpreters are being left around.  Well not really left
> > around, but zombified and left for the OS to clean up.  This is
> > undesirable since in the course of several seconds this app could
> > potentially spawn 20 or so python interpreters, each one only 'alive'
> > for about half a second.  I cannot wait around for the OS to kill the
> > zombies.
> >
> > Is there someway I can remotely terminate a python interpreter through
> > execnet?
>
> afair gateway.close() will clean up and should be used to ensure propper
>  cleanup
>
> >
> > Currently, when the remote interpreter finishes his test I delete the
> > gateway and channel instances from the host and I was hoping that
> > would clean up the python instances on the remote server.  But that
> > does not seem to be the case.
> >
> > Thanks for any guidance.
>
> -- ronny
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/execnet-dev/attachments/20100615/e0a9ed21/attachment.html>


More information about the execnet-dev mailing list