[omniORB] spurious COMM_FAILURE when using fixed ports

Duncan Grisby duncan at grisby.org
Thu Jan 22 10:12:34 UTC 2026


On Thu, 2026-01-22 at 10:13 +0100, Michael Teske via omniORB-list
wrote:


>  omniORB: (5) 2026-01-21 10:34:09.773595: Orderly connection
> shutdown: giop:tcp:[::1]:53234 <-------
>  omniORB: (5) 2026-01-21 10:34:09.773599: throw
> giopStream::CommFailure from
> giopImpl12.cc:192(1,NO,COMM_FAILURE_WaitingForReply) 
> 
> This is not forwarded to the caller but instead the connection is re-
> established as it should be.

As you have realised, the client side of a connection only notices that
the connection has been closed when it tries to send a request – there
is nothing watching client-side connections to notice if they are
closed at an unexpected time, because that would create all sorts of
complexity and overheads.

In this first case, the client sends a request, but when it reads from
the socket to get the reply, it finds the CloseConnection message from
the server. It therefore knows that the server has not processed the
request. It throws the COMM_FAILURE exception with completion status
COMPLETED_NO, because it knows the request was not performed. omniORB's
default COMM_FAILURE exception handler therefore retries the call
because it knows it is safe to do so.


>  What's left is to find out, what happens in our case where we get 
> > 
> >  omniORB: (199) 2026-01-21 10:04:51.861953: Reset rope addresses
> > (current address giop:tcp:[::1]:53234)
> >  omniORB: (199) 2026-01-21 10:04:51.861962: Error in network
> > receive (start of message): giop:tcp:[::1]:53234
> >  omniORB: (199) 2026-01-21 10:04:51.861966: throw
> > giopStream::CommFailure from
> > giopStream.cc:857(0,MAYBE,COMM_FAILURE_WaitingForReply)

Here, the client does not see a CloseConnection message. It just gets a
socket error to say the connection has been closed. I'm not sure why it
did not get the CloseConnection.

The problem now is that it knows it has sent the request, and it knows
that the connection was closed before it got a reply, but it cannot
know whether the server side actually received the request and acted
upon it – it could be that the client did all the work and then a
network error broke the connection.

For that reason, the COMM_FAILURE exception has completion status
COMPLETED_MAYBE.

If it is safe in your application to accept the (small) risk that a
request is replayed after a connection failure, you could register a
COMM_FAILURE exception handler that retries at least once if the
completion status is maybe:

https://omniorb.sourceforge.io/omni43/omniORB/omniORB004.html#sec69


Duncan.

-- 
Duncan Grisby <duncan at grisby.org>



More information about the omniORB-list mailing list