[omniORB] question on behavior of client on server restart - possible hang?

Duncan Grisby duncan at grisby.org
Tue Aug 11 15:33:53 BST 2009


On Tuesday 11 August, Igor Lautar wrote:

[...]
> > You could try setting the SO_KEEPALIVE socket option on omniORB's
> > connections, by adding it to src/lib/omniORB/orbcore/tcp/tcpEndpoint.cc
> > where it sets other options. That will check the connection if it's been
> > idle for a long time.
> 
> Hmm, but SO_KEEPALIVE would not help in case where ORB closes connections 
> after connection idle time?

>From omniORB's point of view, a connection where the client is blocked
waiting for a reply from the server is not "idle", even though there's
no traffic. A connection is only idle (and a candidate for closure) if
there are no calls in progress on it.

Despite its name, SO_KEEPALIVE is actually there to kill a TCP
connection if the network breaks, not to keep the connection alive.

The situation you're in that the client sends a request and the server
sends one or more TCP ACKs so the client knows the data has arrived.
Now the client is waiting for the server to reply, and there is no
traffic at all on the TCP connection. The nature of TCP means that if
the network breaks or the server is uncleanly shut down, the client will
not receive any indication of that, so as far as it's concerned, the
server might still be there. SO_KEEPALIVE sends a test packet every once
in a while, so the client will notice if the server is no longer
reachable, and will close the TCP connection.

Cheers,

Duncan.

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



More information about the omniORB-list mailing list