[execnet-dev] Close remote gateway?

holger krekel holger at merlinux.eu
Wed Jun 16 14:03:05 CEST 2010


On Tue, Jun 15, 2010 at 15:18 -0500, Charles Solar wrote:
> I did see those examples and I remember that I had then wished that
> gateway.exit() had the timeout option that I could use.
> I would use gateway groups, but I am afraid its too restrictive to my
> design.  Currently I setup a bunch of gateways to the target machines, about
> 10 or so, and hold onto the gateway instance in a list along with other
> params like hostname, unique id, etc.  I then allow the user to close
> subsets of remote hosts so something like this works:
> 
> server = RemoteServer()
> server.open( [ 'server1', 'server2', 'server3' ] )
> server.close( ['server1','server2'] )
> 
> which would be much harder if I opened all the servers under one group.

Under the hood you could still use groups - eases wholesale termination
at least.  We could also refine the API to support partial exit.  I'd be
happy to accept patches that help your use case. 

> I went to the location you suggested and changed the value to 1.0 and it did
> in fact help.  The instances fell down just 1 second after I called exit.
> So yes, being able to do gateway.exit( timeout=0.5 ) or something would be
> very nice.  I guess my remote clients are doing busy work that is preventing
> the clean shutdown for 10 seconds, which would explain what I am seeing.

We probably don't want gateway.exit() to wait until the remote side 
terminates.  So someting like gateway.exit(killexec=10) makes sense. 
This would also become a parameter to group.terminate(killexec=10)
or be derived as "timeout * 0.5" or so.  Terminate accepts a timeout
paramater already because it actually waits for termination - but
for all hosts at once. Makes sense to you? 

best,
holger



More information about the execnet-dev mailing list