[omniORB] WaitingForReply Exception

Duncan Grisby duncan@grisby.org
Thu Mar 27 16:14:02 2003


On Wednesday 26 March, Jochen Behrens wrote:

> The client periodically calls a ping method on the server to ensure it 
> is alive. When killing and restarting the server the client 
> automatically reconnects to the server. Then the client calls a method 
> on the server to get an object reference of a further object also 
> provided by the server. The first call on this reference fails with the 
> above mentioned exception.
> Interestingly enough, after catching the exception a second call on the 
> same object reference is successful.

This is an effect of the TCP connection caching that omniORB does.
The first time a client connects to a server, it holds the TCP
connection open until it has been idle for a while.

The situation you are seeing is that the server restarts, so the
cached connection dies. However, the client is still holding what
looks like a valid socket handle. So, the client comes to make another
call, and the ORB marshals a request into the socket. Since it's a
small request, the whole thing fits in a single send call, which the
socket layer accepts without error. It's not until the client tries to
read the reply that it gets a socket error, and raises an exception.
Now, the problem is that it can't tell whether the send of the request
actually worked or not, so it raises an exception with completion
status maybe.

If the same thing occurs but the request involves sending a lot of
data, an exception will arise when sending, meaning the completion
status is known to be no, and omniORB will automatically retry with
another TCP connection.

If what you want is for the call to be retried, you should register a
COMM_FAILURE exception handler that retries once if you get an
exception with minor code WaitingForReply.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan@grisby.org     --
   -- http://www.grisby.org --