Archived

This forum has been archived. Please start a new discussion on GitHub.

Server instanciation in IceGrid

Hi,

the situation:

I instanciate servers with "instantiateServer" in an admin session ("createAdminSession"). (I already have a template)
then I activate this server with a client session ("createSession") and I keep it alive.
All this part is OK, I have, for example, my server "IceBoxMsg-1" instanciated (it appears in IceGrid gui) and activated.

but when I want to instanciate a 2nd server (for ex. "IceBoxMsg-2"), exactly at the moment when I call "instantiateServer", my first server ("IceBoxMsg-1") is de-activated.

Could you explain me what is the thing I have misanderstood and if I have the possibility to instanciate and activate server dynamicly without interferring on the others servers?

thanks

Gilles

Comments

  • benoit
    benoit Rennes, France
    Hi Gilles,

    Yes, this should work -- the instantiation of a server shouldn't cause the other server deactivation. It's not clear to me why this is happening. Did you try adding tracing on the IceGrid node to see if it could give you some clues? You can add tracing by setting the following properties in the node configuration file:
       IceGrid.Node.Trace.Activator=2
       IceGrid.Node.Trace.Adapter=2
       IceGrid.Node.Trace.Server=2
    

    If you can't figure it out, could you provide more information on the configuration of your server instances such as the XML template you're using ?

    Cheers,
    Benoit.
  • Hi,
    this the log I have after the first instantiation:
    ...
    adminsession = registry->createAdminSession("...","...")
    ...
    admin = adminsession->getAdmin();
    ...
    desc._cpp_template = "IceBoxMsg"; // see xml for the template
    desc.parameterValues["name"] = "1";
    admin_l->instantiateServer("OSL", "CDT", desc);
    ...
    admin_l->Destroy();
    ...
    ...
    sessionclient = registry->createSession("...","...");
    ...
    iceobj = sessionclient->allocateObjectByType("::OSL::MSG");
    ...
    // The server is kept alive with a thread using "sessionclient->keepAlive();"

    The log after this code is here
    [ 02/26/09 09:18:51.060 icegridnode: Server: changed server `IceBoxMsg-1' state to `Inactive' ]
    [ 02/26/09 09:18:51.154 icegridnode: Server: changed server `IceBoxMsg-1' state to `Inactive' ]
    [ 02/26/09 09:18:51.154 icegridnode: Activator: activating server `IceBoxMsg-1'
    path = D:\Projets\bis_dev_br_systeam\bis\Output\iceboxd.exe
    pwd = D:\Projets\bis_dev_br_systeam\bis\Output
    args = D:\Projets\bis_dev_br_systeam\bis\Output\iceboxd.exe --Ice.Config=D:\\Projets\\bis_dev_br_systeam\\bis\\Output/IceGrid\\Admin/servers/IceBoxMsg-1/config/config ]
    [ 02/26/09 09:18:51.420 icegridnode: Adapter: server `IceBoxMsg-1' adapter `MSG-1' activated: dummy -t:tcp -h 192.168.30.139 -p 2269 ]
    [ 02/26/09 09:18:51.435 icegridnode: Server: changed server `IceBoxMsg-1' state to `Active' ]

    then I instantiate the 2nd server with the same way
    ...
    adminsession = registry->createAdminSession("...","...")
    ...
    admin = adminsession->getAdmin();
    ...
    desc._cpp_template = "IceBoxMsg"; // see xml for the template
    desc.parameterValues["name"] = "2";// the name has changed
    admin_l->instantiateServer("OSL", "CDT", desc);
    ...
    admin_l->Destroy();
    ...
    ...
    sessionclient = registry->createSession("...","...");
    ...
    iceobj = sessionclient->allocateObjectByType("::OSL::MSG");
    ...
    // The server is kept alive with a thread using "sessionclient->keepAlive();"

    here is the log
    [ 02/26/09 09:20:12.434 icegridnode: Activator: deactivating `IceBoxMsg-1' using process proxy ]
    [ 02/26/09 09:20:12.434 icegridnode: Adapter: server `IceBoxMsg-1' adapter `MSG-1' deactivated ]
    [ 02/26/09 09:20:12.559 icegridnode: Activator: detected termination of server `IceBoxMsg-1' ]
    [ 02/26/09 09:20:12.559 icegridnode: Adapter: server `IceBoxMsg-1' adapter `MSG-1' deactivated ]
    [ 02/26/09 09:20:12.559 icegridnode: Server: changed server `IceBoxMsg-1' state to `Inactive' ]
    [ 02/26/09 09:20:12.574 icegridnode: Server: changed server `IceBoxMsg-1' state to `Inactive' ]
    [ 02/26/09 09:20:12.574 icegridnode: Server: changed server `IceBoxMsg-2' state to `Inactive' ]
    [ 02/26/09 09:20:12.637 icegridnode: Server: changed server `IceBoxMsg-2' state to `Inactive' ]
    [ 02/26/09 09:20:12.637 icegridnode: Activator: activating server `IceBoxMsg-2'
    path = D:\Projets\bis_dev_br_systeam\bis\Output\iceboxd.exe
    pwd = D:\Projets\bis_dev_br_systeam\bis\Output
    args = D:\Projets\bis_dev_br_systeam\bis\Output\iceboxd.exe --Ice.Config=D:\\Projets\\bis_dev_br_systeam\\bis\\Output/IceGrid\\Admin/servers/IceBoxMsg-2/config/config ]
    [ 02/26/09 09:20:12.746 icegridnode: Adapter: server `IceBoxMsg-2' adapter `MSG-2' activated: dummy -t:tcp -h 192.168.30.139 -p 2298 ]
    [ 02/26/09 09:20:12.762 icegridnode: Server: changed server `IceBoxMsg-2' state to `Active' ]

    I saw that the Activator deactivate my first server. But why, I don't know, I put the xml in attached file. the template is "IceBoxMsg"

    thanks if you can understand my problem.

    Gilles
  • benoit
    benoit Rennes, France
    Hi Gilles,

    Thanks, I'm able to reproduce this issue now. I'm afraid it looks like a bug in the IceGrid registry. I'm looking into a fix and will keep you posted on the progress.

    Cheers,
    Benoit.
  • benoit
    benoit Rennes, France
    Hi Gilles,

    I've posted a patch here. Thanks for the bug report, the fix will be included in the next patch release.

    Cheers,
    Benoit.
  • Sorry for my answer a little bit late.

    It works great with the patch now, tanks a lot for solving my problem really fast.

    best regards

    Gilles