Pyro problems...

A

adam

I'm using Pyro to develop a distribuited system

running my integration test suite I've found a strange
behaviour

it seems that whenever I have a failed resolve or unregister on
a name server, the name server acts normally during its life
span, but when I shut it down... something remains up...

if, afterwards, i lookup for a name server python freezes
and if i try to start a new name server, the port look occupied

is this a Pyro issue? or is that just me, that I've lost something
important?

i'll attach the code that causes the freeze

thanks!

Vieri


***


print('test_pyro_bug')
timeout = 10
#init pyro
Pyro.core.initServer(0)
Pyro.core.initClient(0)
#start name server
ns_host = 'localhost'
ns_port = 9090
name_server_starter = Pyro.naming.NameServerStarter()
name_server_thread = threading.Thread(
target = name_server_starter.start,
args = (ns_host, ns_port))
name_server_thread.setDaemon(True)
name_server_thread.start()
name_server_starter.waitUntilStarted(timeout)
#locate name server
locator = Pyro.naming.NameServerLocator()
name_server = locator.getNS(ns_host, ns_port)
name_server.createGroup( "my_group" )
#init daemon
daemon = Pyro.core.Daemon()
daemon.useNameServer(name_server)
daemon_thread = threading.Thread(
target = daemon.requestLoop,
args = ())
daemon_thread.setDaemon(True)
daemon_thread.start()
#try to unregisater a non existent object
dummy_name = "my_group" + ".dummy"
dummy = _DummyRemote()
daemon.connect(dummy, dummy_name)
try:
name_server.unregister(dummy_name + "not found")
except Pyro.core.NamingError:
pass
#shutdown daemon
daemon.shutdown()
daemon = None
daemon_thread.join(timeout)
daemon_thread = None
#shutdown name server
name_server._shutdown()
name_server_thread.join(timeout)
name_server_thread = None
#locate name server
locator = Pyro.naming.NameServerLocator()
##freezes here!
self.failUnlessRaises(
Pyro.core.ProtocolError,
locator.getNS, ns_host, ns_port)



------------------------------------------------
Vieri del Bianco
CEFRIEL · Politecnico di Milano
Via Fucini, 2 · 20133 Milano (Italy)
t: +39 0223954355
e: (e-mail address removed)
w: http://www.cefriel.it
------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top