[omniORB] Deferred exception in oneway method

Duncan Grisby duncan@grisby.org
Tue Apr 8 12:36:01 2003


On Thursday 3 April, Serguei Kolos wrote:

> Probably this is a well known feature of the oneway methods in CORBA,
> but I was unpleasantly surprised when found that the nonexistence of
> the remote object is not  recognized correctly if one doing a oneway
> request to it.

The whole point of oneways is that all bets are off as to whether call
is delivered, and whether the client gets to know about it.

>   Consider the following scenario (I did it using omniORB):
> 1. I started the server which implements oneway method
> 2. start client which calls this method once per 5 seconds
> 3. client calls the method successfully
> 4. I kill the server
> 5. (5 seconds later) client calls the method again ... and does not see 
> any problems
> 6. (5 seconds later) client calls the method again ... and got 
> SystemException

The reason this happens is that at step 5, the client sends a packet
through a now-dead TCP connection. Since it's an asynchronous oneway,
it doesn't hang around to find out whether the send works or not. If
it did, it wouldn't be a oneway call.

At step 6, the OS has now noticed that the TCP connection has broken
(due to the failed send at step 5), so omniORB notices, tries to open
a new connection, fails, and so gives you a TRANSIENT exception.

There is no way to avoid this behaviour, other than to resist the
dangerous lures of the oneway.

Cheers,

Duncan.

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