Archived

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

about DisableOnFailure

Hi guys
Any body can help us? Thanks in advance.
We encountered two problems when we use the IceGrid to
manage(start,monitor,stop) our programs.
1 When our program crashed because of NULL pointer, IceGrid didnot start the
program again as we expected and the status of server became "disabled".
But we has setted the server's boot mode to "always" and
IceGrid.Node.DisableOnFailure=0.
We expect IceGrid can detecte our program crashed and start our program
again,and it status should always be "active".
Moreover,We tried to set IceGrid.Node.DisableOnFailure to a non-zero value,
it didn't take any effect.

2 Sometimes icegridnode cannot generate config file when it was started.
Sometime it did the work.

Our test bed: Cetnos5 64bits and ICE3.4.2

Belowing is our test code and configuration. This program will be terminated
unexpectedly with signal SIGSEGV.


hello.cpp:

#include <iostream>
using namespace std;

int main()
{
cout<<"hello"<<endl;
char* a;
a[3] = 'a';
cout<<"hello2"<<endl;

return 0;
}

hello.xml:
<icegrid>
<application name="hello">
<node name="helloNode">
<server id="helloServer" exe="./hello" activation="always">
<adapter name="helloAdapter" id="helloAdapter"
endpoints="tcp"/>
<property name="Ice.Default.Locator" value="tcp -p 10000"/>
</server>
</node>
</application>
</icegrid>

hello.node:
Ice.Default.Locator=testGrid/Locator: default -p 4061 -t 5000
#Ice.Default.EndpointSelection=Ordered
IceGrid.Node.Name=helloNode
IceGrid.Node.Endpoints=default -t 5000
IceGrid.Node.Data=db
IceGrid.Node.DisableOnFailure=0

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Yes, regardless of the value of the DisableOnFailure property, IceGrid will deactivate servers that fail to activate if they have the "always" activation mode.

    If your server did activate successfully it would work as you expect. A server is considered to activate successfully by IceGrid if it registers the endpoints of the object adapters declared in its XML descriptor. With your test case, you should first make sure activation succeeds by creating the communicator, object adapter and activating the object adapter. I recommend using the IceGrid simple demo to try this out, you can for instance add the code that raises the SEGFAULT after the adapter activate call to see if it behaves correctly.

    Cheers,
    Benoit.
  • Sometimes icegridnode cannot generate config file when it was started.
    Sometime it did the work.