[omniORB] spurious COMM_FAILURE when using fixed ports

Michael Teske subscribe at teskor.de
Fri Jan 23 07:40:12 UTC 2026


Hi Duncan,


On 1/22/26 11:12, Duncan Grisby wrote:
>
>>   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.

As I wrote in the next mail this difference comes from the fact that in our system we use client timeouts everywhere.

In this case waitRead() is used, and if USE_POLL is set, it will return an error and so that the CloseConnection message which

is still in the buffer is not read. It works fine for me with this patch:

--- snip ---

Index: include/omniORB4/internal/tcpSocket.h
===================================================================
--- include/omniORB4/internal/tcpSocket.h    (revision 1135)
+++ include/omniORB4/internal/tcpSocket.h    (working copy)
@@ -362,7 +362,7 @@
      int timeout = t.tv_sec*1000+((t.tv_usec+999)/1000);
      if (timeout == 0) timeout = -1;
      rc = poll(&fds, 1, timeout);
-    if (rc > 0 && fds.revents & POLLERR) {
+    if (rc > 0 && !(fds.revents & POLLIN) && fds.revents & POLLERR) {
        rc = RC_SOCKET_ERROR;
      }
  #else
--- snip ---

poll sets here POLLIN and POLLERR, and in the original code, the CloseConnection is not read.

There's possibly a more correct way to adress this but it would be nice to process any outstanding data before setting the connection to error.


Anyway I would also like to suggest this additional little patch, which would have saved me some time:

--- snip ---

Index: src/lib/omniORB/orbcore/giopServer.cc
===================================================================
--- src/lib/omniORB/orbcore/giopServer.cc    (revision 1135)
+++ src/lib/omniORB/orbcore/giopServer.cc    (working copy)
@@ -451,6 +451,12 @@

    omni_thread::get_time(deadline, timeout);

+  if (omniORB::trace(25)) {
+      omniORB::logger log;
+      log << "server sendCloseConnection: to " << s->connection->peeraddress()
+      << " 12 bytes\n";
+    }
+
    int tx = s->connection->Send(hdr, 12, deadline);
    if (tx <= 0 && omniORB::trace(25)) {
      omniORB::logger log;
--- snip ---

so _all_ CloseConnections are logged. It was a bit confusing to find the message in wireshark but not in the logs.

Greetings,

   Michael







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.omniorb-support.com/pipermail/omniorb-list/attachments/20260123/43655a45/attachment.htm>


More information about the omniORB-list mailing list