Results 1 to 3 of 3

Thread: Ice hangs when glacier is restarted

  1. #1
    vsevolod is offline Registered User
    Name: Vsevolod Fedorov
    Organization: "NTC Komset"
    Project: telecom monitoring (ss7,sigtran,etc) software
    Join Date
    Oct 2009
    Posts
    4

    Ice hangs when glacier is restarted

    Hello.

    I use glacier2 router and icegrid.
    When icegrid with router is restarted the client can not reconnect to icegrid's servers objects - it hangs. Wireshark shows that Ice is calling ice_isA method indefinitely without a pause.
    To reproduce it three files are sufficient:
    config:
    Code:
    Ice.Default.Host=localhost
    Ice.Default.Locator=IceGrid/Locator:tcp -p 4061
    
    IceGrid.Registry.Client.Endpoints=tcp -p 4061
    IceGrid.Registry.Server.Endpoints=tcp
    IceGrid.Registry.Internal.Endpoints=default
    IceGrid.Registry.Data=db/registry
    IceGrid.Registry.PermissionsVerifier=IceGrid/NullPermissionsVerifier
    IceGrid.Registry.AdminPermissionsVerifier=IceGrid/NullPermissionsVerifier
    IceGrid.Node.Name=localhost
    IceGrid.Node.Endpoints=default
    IceGrid.Node.Data=db/node
    IceGrid.Node.CollocateRegistry=1
    IceGridAdmin.Username=foo
    IceGridAdmin.Password=bar
    app.xml:
    Code:
    <icegrid>
      <application name="Simple">
        <node name="localhost">
           <server id="glacier" exe="glacier2router" activation="always">
            <property name="Glacier2.Client.Endpoints" value="tcp -h localhost -p 4063"/>
            <property name="Glacier2.Server.Endpoints" value="tcp -h localhost"/>
            <property name="Glacier2.SessionTimeout" value="60"/>
            <property name="Glacier2.PermissionsVerifier" value="Glacier2/NullPermissionsVerifier"/>
            <property name="Glacier2.Trace.Session" value="1"/>
          </server>
        </node>
      </application>
    </icegrid>
    client.py:
    Code:
    #!/usr/bin/env python
    
    import time, sys, Ice, Glacier2, IceGrid
    
    
    
    class Client(Ice.Application):
    
      def run(self, args):
        obj = None
        while True:
          if obj:
            if not self.ping(obj):
              obj = None
          else:
            obj = self.connect()
          time.sleep(2)
    
      def connect( self ):
        ic = self.communicator()
        try:
          router = ic.stringToProxy('Glacier2/router:tcp -h localhost -p 4063')
          router = Glacier2.RouterPrx.checkedCast(router)
          session = router.createSession('', '')
          query = ic.stringToProxy('IceGrid/Query')
          query = query.ice_router(router)
          print 'casting...'
          obj = IceGrid.QueryPrx.checkedCast(query)  # hangs here after reconnect
          print 'casting... done.'
          return obj
        except Ice.Exception, x:
          return None
    
      def ping( self, obj ):
        try:
          obj.ice_ping()
          return True
        except Ice.Exception, x:
          return False
    
    
    app = Client()
    sys.exit(app.main(sys.argv))
    First start icegrid:
    Code:
    $ icegridnode --Ice.Config=config --deploy app.xml
    Then start client.py in another window. After that kill icegridnode and start it again.

    Code:
    $ ./client.py
    casting...
    casting... done.
    casting...
    Tested on Ice 3.3.1 under linux
    Last edited by vsevolod; 10-28-2009 at 06:32 AM.

  2. #2
    benoit's Avatar
    benoit is online now ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Hi,

    This is a known problem where the Ice communicator is caching some information which prevent a new session from being created.

    You need to destroy the communicator after the session is destroyed and create a new communicator before establishing a new session. Another option is to create an object adapter associated with the router after the session is created and destroy it once the session is destroyed.

    Cheers,
    Benoit.

  3. #3
    vsevolod is offline Registered User
    Name: Vsevolod Fedorov
    Organization: "NTC Komset"
    Project: telecom monitoring (ss7,sigtran,etc) software
    Join Date
    Oct 2009
    Posts
    4

    Thanks

    Hello.

    Thank you, Benoit. Workaround with adapter works fine.

    Vsevolod

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Ice 'hangs' in destroy when called through DLL
    By DaVinci79 in forum Help Center
    Replies: 8
    Last Post: 10-17-2008, 01:23 PM
  2. IceStorm hangs
    By ctennis in forum Help Center
    Replies: 5
    Last Post: 05-22-2008, 08:21 AM
  3. IceStorm hangs
    By T. Barry in forum Help Center
    Replies: 1
    Last Post: 03-02-2006, 03:49 AM
  4. Replies: 4
    Last Post: 11-21-2004, 10:22 PM
  5. Ice::initialize hangs on Panther
    By taweili in forum Help Center
    Replies: 0
    Last Post: 11-02-2003, 06:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •