Shutdown a nameserver in Pyro4 without manual interruption

52 Views Asked by At

I know the current development is in Pyro5 but I am using another package (Pyomo) that is still dependent on Pyro 4. For some reason I am not being able to terminate the name server while submitting a slurm request. I have a nameserver as one process, dispatch server as another process, and there are a few more processes for solver server. I can get the result and everything is working fine for me. However, it is annoying that all of the solver servers and dispatch server gets terminated at the end but nameserver does not. This is okay if I run it via terminal where I can force the nameserver shutdown using Ctrl + C but how to enforce this when submitting a job request via slurm?

Dispatch server can be terminated using: proxy.shutdown() where proxy = Pyro.proxy("uri of dispatch server") followed by proxy._pyroRelease(). However, the same process does not work for nameserver and the job halts at that point until I cancel the job using scancel. This is hindering me from submitted multiple job arrays as the nameserver is not terminated without manual interruption.

Is there a way to handle this?

I tried the following:

ns = Pyro.locateNS() 
uri = ns.lookup("Pyro.NameServer")
proxy = Pyro.Proxy(uri)

proxy.shutdown() # also tried proxy._shutdown() and proxy._pyroshutdown()
proxy._pyroRelease()

But the error pops up as I figured out proxy does not have any of those methods to shutdown a server.

0

There are 0 best solutions below