[omniORB] TCP timeout delay when host is unreachable: a solution

thomas.hautesserres at kodak.com thomas.hautesserres at kodak.com
Tue Oct 5 12:55:15 BST 2004


I have reported this problem last week, and the solution proposed by Jay
Welch & Renny Koshi is working perfectly.
I just wanted to post a complete summary so that people encountering the
same problem later will be able to find a quick solution by searching the
email archive.

My original post:

> We are using omniORB 4.0.2 on both Solaris and Windows.
> We have a problem occuring only for Solaris processes : when an object
reference points to an unreachable host (usually our Naming Service host,
accessed through a corbaname URL), it takes up to 3 minutes for the CORBA
call to return.
> As having unreachable remote sites is part of the "normal" situation for
our application (or at least should be supported without large performance
impact), this is somehow not acceptable.

The proposed solution: use client timeouts to limit the length of the
calls, including the first one making the connection.

For us, we have chosen to use timeouts for all calls to the Naming Service
as if the NS host is not reachable, then our remote objects are also
unreachable.

Code sample:

    if (CORBA::is_nil(m_rootContext))
    {
        // Root context URL is "corbaname::host:port"
        CORBA::Object_var obj = m_orb->string_to_object(m_rootURL.c_str());

#ifndef WIN32
        // On Solaris, using an object reference on an unreachable host
        // can take up to 3 minutes to fail. Therefore, we use a 2 seconds
        // timeout for all Naming Service calls (at least on root context).
        omniORB::setClientCallTimeout(obj.in(), 2000);
#endif

        m_rootContext = CosNaming::NamingContext::_narrow(obj);
    }

Thanks to all people that have helped us resolve this problem!

Thomas




More information about the omniORB-list mailing list