[omniORB] Re: oneway callback gets lost
Duncan Grisby
duncan at grisby.org
Fri Apr 6 19:22:23 BST 2007
On Thursday 5 April, Jonathan Biggar wrote:
> Duncan Grisby wrote:
> > It's a fundamental limitation of CORBA oneway messages.
>
> Actually, it's an issue of a design choice in omniORB.
Well, yes and no. The fact that it can take quite a long time for
omniORB to notice a connection closure when sending only oneway messages
is the result of a design choice. The fact that a number of oneways can
be lost because they are sent before the client notices a connection has
been closed _is_ a fundamental artifact of the way oneways work. The
client can send a stream of oneways that are all in flight while a
CloseConnection message and TCP closure are going the other way.
You are right that omniORB could notice connection closures sooner than
it does by monitoring the connections it has open. That is only
necessary if the connection is used only (or primarily) for oneways,
since with normal two-way calls the closure is noticed when trying to
receive the reply.
Both of the obvious ways to monitor a connection would have quite a
significant performance impact. One way would be to use a thread that
monitored outgoing connections so it noticed connection closures as soon
as they occurred. That would have the side-effect of triggering for all
expected reply messages, as well as closures, and would therefore waste
time with thread switching on all replies.
The alternative would be for a thread that's about to send a oneway call
to select or poll the connection to see if there are any pending
messages, before sending the oneway. That would have a noticeable impact
on sending performance.
Both those approaches are quite complex and impact performance, and
don't avoid the possibility of losing oneways anyway, merely reduce the
number of oneways than can be lost. It's rather unfortunate that
most operating systems allow send() calls to succeed for quite a while
after the underlying TCP connection has closed.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- duncan at grisby.org --
-- http://www.grisby.org --
More information about the omniORB-list
mailing list