View Single Post
  #3 (permalink)  
Old 05-06-2008
spsoni's Avatar
spsoni spsoni is offline
Registered User
 
Name: Sury P Soni
Organization: Next Digital
Project: Unified Messaging Plattform for Inhouse Products
 
Join Date: Mar 2008
Location: Melbourne, Australia
Posts: 14
Quote:
I am using FreeBSD with Ice 3.1.1 and C++ for server and python for clients.
Thank you Michi.

Quote:
If the server does not have RegisterProcess set, IceGrid first tries to kill the server with SIGTERM
I have implemented CtrlCHandler to handle termination signal from IceGrid and unchecked RegisterProcess thing so that IceGrid shall send SIGTERM to my application. Now my application terminates smoothly and restarts on next request from client.

Now, I am facing two problems as follows:

1. Occasionally, when my server application is terminating (using stop from IceGrid Admin tool), I can log that callback ( ice_response ) has been send from server, but my client application do not receive that callback. I am even using adapter.deactivate() and adapter.waitForDeactivate() things, so that it shall send all the callback responses back to clients. But, I am bit confused, how can we trace, whether callback has been successfully send to client. As ice_response() do not throw any exception!

2. When I am trying to terminate my server application by unix kill command using process id from icegrid admin GUI tool, it is throwing exception directly to my client application, rather than somehow icegrid noticing this server termination and restart new instance for client to be served. I have used different parameters with kill command (1,2,3,6,9,14,15) and I was getting NoEndpointExcpetion and ConnectionLostException with them. Please explain, how can I let icegrid interfere in such application termination and restart new instance of the server for clients to be served.


My client is connecting to server using registry through following code.

Code:
class ChannelManager:
    def __init__(self, argv,configFile=None):
        """
            Some data initialisation to load configurations from file.
        """
        initData = Ice.InitializationData()
        if configFile:
            initData.properties = Ice.createProperties()
            initData.properties.load(configFile)

        """
            Actual communicator object initialisation.
        """
        self.communicator = Ice.initialize(argv,initData)

    def _create_channel(self, stringified_proxy):
        try :
            channel=Dbice.DbInterfacePrx.checkedCast(self.communicator.stringToProxy(stringified_proxy))
        except Ice.NotRegisteredException:
            proxy = "IceGrid/Query"
            query = IceGrid.QueryPrx.checkedCast(self.communicator.stringToProxy(proxy))
            identity = Ice.Identity(stringified_proxy)
            channel = Dbice.DbInterfacePrx.checkedCast(query.findObjectById(identity))
        except Ice.ConnectionRefusedException, e :
            raise e
        except Ice.ConnectionLostException, e :
            raise e
        except :
            traceback.print_exc()

        if not channel :
            raise RuntimeError("invalid proxy")
        return channel
Thanks in advance.
Reply With Quote