Pyro problems...

Discussion in 'Python' started by adam, Jan 23, 2006.

  1. adam

    adam Guest

    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:
    w: http://www.cefriel.it
    ------------------------------------------------
    adam, Jan 23, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Irmen de Jong

    ANN: Pyro 3.3 beta

    Irmen de Jong, Jul 2, 2003, in forum: Python
    Replies:
    0
    Views:
    361
    Irmen de Jong
    Jul 2, 2003
  2. Irmen de Jong

    ANN: Pyro 3.3 (remote objects)

    Irmen de Jong, Aug 14, 2003, in forum: Python
    Replies:
    0
    Views:
    297
    Irmen de Jong
    Aug 14, 2003
  3. Golawala, Moiz M (GE Infrastructure)

    Problems with py2exe and Pyro

    Golawala, Moiz M (GE Infrastructure), Jul 29, 2004, in forum: Python
    Replies:
    0
    Views:
    335
    Golawala, Moiz M (GE Infrastructure)
    Jul 29, 2004
  4. John French

    [Pyro] Newbie Question Regarding Pyro

    John French, Jan 7, 2005, in forum: Python
    Replies:
    0
    Views:
    273
    John French
    Jan 7, 2005
  5. writeson
    Replies:
    0
    Views:
    297
    writeson
    Mar 20, 2008
Loading...

Share This Page