Discussion:
[omniORB] How to handle server shutdown
Toni Cebrián
2009-05-29 13:39:01 UTC
Permalink
Hi,

We have a problem trying to reach a server that has been shut down and
restarted. The setup is as follow, we have a Client that access the
NameService asking for the server reference. It then stores the narrowed
object for later access. Then I shutdown the server, I restart again, the
server does a rebind in the NameService, and waits por connections. The
server is started with de -ORBendPoint giop:tcp:my_machine:my_port option in
the command line. The server is perfectly functional for other clients, but
the former client isn't able to communicate with the server. It doesn't
complain about anything, nor CORBA::Transient nor CORBA::COMM_ERRORs when
sending requests but the server doesn't manages the requests. I supose that
there is something I'm doing wrong but I can't see what.
The question is, which is the best way you make your clients fault
tolerant to CORBA server failures? It seems that restarting the server
listening in the same port doesn't work for me.

Best regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20090529/3f3eb761/attachment-0001.htm
Nigel Rantor
2009-05-29 20:16:20 UTC
Permalink
Post by Toni Cebrián
Hi,
We have a problem trying to reach a server that has been shut down
and restarted. The setup is as follow, we have a Client that access the
NameService asking for the server reference. It then stores the
narrowed object for later access. Then I shutdown the server, I restart
again, the server does a rebind in the NameService, and waits por
connections. The server is started with de -ORBendPoint
giop:tcp:my_machine:my_port option in the command line. The server is
perfectly functional for other clients, but the former client isn't able
to communicate with the server. It doesn't complain about anything, nor
CORBA::Transient nor CORBA::COMM_ERRORs when sending requests but the
server doesn't manages the requests.
What do you see from the client side then? Are you sure you're not
swallowing some exception? I would expect something like INV_OBJREF to
be thrown...either that or my idea about what your problem is may be wrong.
Post by Toni Cebrián
I supose that there is something
I'm doing wrong but I can't see what.
The question is, which is the best way you make your clients fault
tolerant to CORBA server failures? It seems that restarting the server
listening in the same port doesn't work for me.
I think this is because you just found out that it's not just the
host/port combo that uniquely identifies a remote object.

There is more information in the IOR that tells the server exactly which
object within its active set this IOR refers to.

If you want an object to be accessible over repeated server runs then
you have to arrange to set this piece of information yourself.

You'll need to set the ID assignment policy to USER_ID in the POA you're
activating the servant in.

Then you need to decide on the exact ID to give it, but that's up to you
really, it's just an opaque bit of data to uniquely identify the object
within the context of the server.

I don't have an example laying around, but it's not too hard to get
these kind of servers running on well-known ports and a well-known
object ID so that they can be found repeatedly without multiple
CosNaming lookups.

The *other* option is to correctly identify when a remote object is not
available (see above, you *should* have got an exception) and go and
lookup the object again before continuing.

Regards,

n
Alvaro Vega Garcia
2009-06-01 16:57:30 UTC
Permalink
Hi,
Post by Toni Cebrián
Hi,
We have a problem trying to reach a server that has been shut down
and restarted. The setup is as follow, we have a Client that access
the NameService asking for the server reference. It then stores the
narrowed object for later access. Then I shutdown the server, I
restart again, the server does a rebind in the NameService, and waits
por connections. The server is started with de -ORBendPoint
giop:tcp:my_machine:my_port option in the command line. The server is
perfectly functional for other clients, but the former client isn't
able to communicate with the server. It doesn't complain about
anything, nor CORBA::Transient nor CORBA::COMM_ERRORs when sending
requests but the server doesn't manages the requests. I supose that
there is something I'm doing wrong but I can't see what.
The question is, which is the best way you make your clients fault
tolerant to CORBA server failures? It seems that restarting the server
listening in the same port doesn't work for me.
How did you obtain the server reference? If you are using "oneway" calls
and you obtained the reference using "unchecked_narrow" maybe the client
is not notified about something was wrong (specially when client was
able to connect with server before was restarted). Make sure you are
using checked references or use "_is_a" to check the reference.

Regards,
?lvaro
Post by Toni Cebrián
Best regards.
Loading...