Pyro problems...

adam vieri.delbianco at gmail.com
Mon Jan 23 12:41:37 CET 2006


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: vieri.delbianco at cefriel.it
w: http://www.cefriel.it
------------------------------------------------




More information about the Python-list mailing list