[omniORB] Synchronization between omniNames service & Services

Michael omniorb at bindone.de
Mon Aug 4 15:17:29 BST 2008


Hi,

there is no constant synchronisation between the two. You just register
an IOR at the naming service in a specific context (this is basically
like writing information to a database).

You could do the following on slave retart.

try
{
  context->bind(name, objref);
}
catch(CosNaming::NamingContext::AlreadyBound& ex)
{
  context->rebind(name, objref);
}

This assumes that context is the context you want to register in ("path"
in the naming service), objref is the object reference of your slave
service and name in the name you want to register (CosNaming::Name).

If you want a failsafe setup, using the naming service to determine if a
service exists might not be the best idea. As an alternative you could
bind master and slave to fixed endpoints (-ORBendPoint) and use resolve
intial references, e.g. by using omniMapper or inside of your code (see
omniNames source for an example of how to do that) and configure the
reference in omniORB.cfg:

InitRef = MyMaster=corbaloc::127.0.0.1:20000/MyService
InitRef = MySlave=corbaloc::127.0.0.1:20001/MyService

as an alternative you should be able to specify multiple endpoints in
InitRef, so the ORB will try both endpoints in the specified order (I
never did this, so maybe somebody else could provide informations about
this).

cheers
michael



R. P. Janaka wrote:
> Hi all,
> 
> I am writing a simple Fault tolerant server which can handle client request
> without any service interruption..Using C++ & omniORB
> 
> In my system there are two servers as Master & Slave..
> 
> When they starts they get registered with the name service as usual.
> Normally the first one will be the Master and the next one is the slave.
> 
> All are working properly..But still have a simple problem which I was unable
> to solve. It is as follows.
> 
> 
>    - When both Master & Slave are running....
>    - Manually kill the Slave
>    - Start the Slave again.
> 
> In some situation this Slave restart does not work properly.. it gives an
> exception. This exception is my own exception and It says that Slave already
> exist.
> This happens only randomly, but occurring frequency is pretty high. (at
> least 30% of the time it will happen)
> 
> If I retry several times I could get success. Because If I call start method
> within the catch block I can really reduce the occurring frequency of this
> exception.
> 
> 
> So I guess the problem is with the name service. Because when I just kill
> the Slave, the name service does not know anything about this killing. So it
> is still keep registering details of the Slave. Because of that it gives and
> exception when I am going to register the Slave again.
> 
> Please can anyone guess any other reason for this problem.....?
> 
> If my guess is correct...Please can anyone help me to solve this problem..
> Is there a continues synchronization between the name service and the
> service itself .....?
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list




More information about the omniORB-list mailing list