[omniORB] transient exception handler and call timeout problem

Vladislav Vrtunski vladislav.vrtunski at dmsgroup.co.yu
Mon Apr 25 18:11:25 BST 2005


Wernke zur Borg wrote:

>Hi,
>
>I guess you have overlooked the COMM_FAILURE_UnMarshalArguments in the
>server trace. This often means that the IDL was changed and the code was
>adapted on one side but not at the other. It can have other reasons, though.
>So before further investigating the timeouts I would get rid of those. Also
>make sure to have a last catch clause for the exceptions not caught by
>specific handlers.
>
>Wernke
>  
>
Hi Wernke,

    Sorry for the delay. We have run our tests again, thoroughly, and 
are sure that we have built both the server and the client from the same 
idl file (same stub/skeleton files). We had all the catch clauses to 
start with, we just didn't want to make our original mail too long. We 
have tried both 4.0.5 and 4.0.6 versions of omniORB and got the same 
results. It seams that COMM_FAILURE_UnMarshalArguments is raised when 
the client gets TRANSIENT_CallTimedout but the server method has not 
finished yet. The second time the COMM_FAILURE_UnMarshalArguments is 
raised, even though the server method is not reached. Here are the trace 
logs again, we have set omniORB trace level to 25 and, also, included 
some of our own traces.
*
Server trace:*

############################
omniORB: Server accepted connection from giop:tcp:192.168.0.54:1400
omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 3
omniORB: giopWorker task execute.
omniORB: Accepted connection from giop:tcp:192.168.0.54:1400 because of 
this rule: "* tcp"
omniORB: inputMessage: from giop:tcp:192.168.0.54:1400 38 bytes
omniORB: Handling a GIOP LOCATE_REQUEST.
omniORB: sendChunk: to giop:tcp:192.168.0.54:1400 20 bytes
omniORB: inputMessage: from giop:tcp:192.168.0.54:1400 84 bytes
omniORB:  recieve codeset service context and set TCS to (ISO-8859-1,UTF-16)

IServer::GetStatus() entered

IServer::GetStatus() - sleeping 3 seconds.

omniORB: AsyncInvoker: thread id = 4 has started. Total threads = 4
omniORB: giopWorker task execute.
omniORB: throw giopStream::CommFailure from 
giopStream.cc:831(0,NO,COMM_FAILURE_UnMarshalArguments)

IServer::GetStatus() - awaken.


IServer::GetStatus() exiting

omniORB: sendChunk: to giop:tcp:192.168.0.54:1400 28 bytes
omniORB: Server connection refcount = 1
omniORB: Server connection refcount = 0
omniORB: Server close connection from giop:tcp:192.168.0.54:1400
omniORB: AsyncInvoker: thread id = 4 has exited. Total threads = 4
omniORB: AsyncInvoker: thread id = 3 has exited. Total threads = 3
omniORB: Server accepted connection from giop:tcp:192.168.0.54:1402
omniORB: AsyncInvoker: thread id = 5 has started. Total threads = 3
omniORB: giopWorker task execute.
omniORB: Accepted connection from giop:tcp:192.168.0.54:1402 because of 
this rule: "* tcp"
omniORB: throw giopStream::CommFailure from 
giopStream.cc:831(0,NO,COMM_FAILURE_UnMarshalArguments)
omniORB: Server connection refcount = 1
omniORB: Server connection refcount = 0
omniORB: Server close connection from giop:tcp:192.168.0.54:1402
omniORB: AsyncInvoker: thread id = 5 has exited. Total threads = 3
############################
*
Client trace:*

############################
Call timeout set to 2000 milliseconds.

Choose option:
         1) Get status
         2) Set status
         q) Quit
 >> 1
omniORB: LocateRequest to remote: root<0>
omniORB: Client attempt to connect to giop:tcp:192.168.0.96:2263
omniORB: Client opened connection to giop:tcp:192.168.0.96:2263
omniORB: sendChunk: to giop:tcp:192.168.0.96:2263 38 bytes
omniORB: inputMessage: from giop:tcp:192.168.0.96:2263 20 bytes
omniORB:  send codeset service context: (ISO-8859-1,UTF-16)
omniORB: sendChunk: to giop:tcp:192.168.0.96:2263 84 bytes
omniORB: throw giopStream::CommFailure from 
giopStream.cc:831(0,MAYBE,TRANSIENT_CallTimedout)
omniORB: Client connection refcount = 0
omniORB: Client close connection to giop:tcp:192.168.0.96:2263

Transient handler called. Retries = 0

omniORB:  send codeset service context: (ISO-8859-1,UTF-16)
omniORB: Client attempt to connect to giop:tcp:192.168.0.96:2263
omniORB: throw giopStream::CommFailure from 
giopStream.cc:1073(0,NO,TRANSIENT_ConnectFailed)

Transient handler called. Retries = 1

omniORB: throw TRANSIENT from omniObjRef.cc:759 (NO,TRANSIENT_ConnectFailed)

TRANSIENT exception caught! Code = 1096024066
############################

Here are also improved code fragments (if you need the complete source, 
let us know and we will send it):

*Server method code:*

CORBA::Long IServer_i::GetStatus()
{
    tcout << endl << _T("IServer::GetStatus() entered") << endl;

#ifdef _WIN32
    ::Beep(750, 250);
#endif

    if (((m_nCallCounter++ % 2) == 0) && (m_nTimeToSleep > 0))
    {
        tcout << endl << _T("IServer::GetStatus() - sleeping ") << 
m_nTimeToSleep << _T(" seconds.") << endl << endl;

        omni_thread::sleep(m_nTimeToSleep);

        tcout << endl << _T("IServer::GetStatus() - awaken.") << endl << 
endl;
    }

    tcout << endl << _T("IServer::GetStatus() exiting") << endl << endl;

    return m_nStatus;
}

*Client code:
*
CORBA::Boolean TransientHandler(void* pCookie, CORBA::ULong nRetries, 
const CORBA::TRANSIENT& ex)
{
   cerr << endl << "Transient handler called. Retries = " << nRetries << 
endl << endl;
   return ((nRetries < 1) ? 1 : 0);
}

CORBA::Boolean CommFailureHandler(void* pCookie, CORBA::ULong nRetries, 
const CORBA::COMM_FAILURE& ex)
{
   cerr << endl << "CommFailure handler called. Retries = " << nRetries 
<< endl << endl;
   return ((nRetries < 1) ? 1 : 0);
}

long GetStatus(IServer_ptr pServer)
{
    long nStatus = 0;
    bool bRetry = false;

//    do {
        try
        {
            nStatus = pServer->GetStatus();
            tcout << endl << _T("Server status is ") << nStatus << endl;
            bRetry = false;
        }
        catch (CORBA::TRANSIENT& ex)
        {
            tcout << endl << _T("TRANSIENT exception caught! Code = ") 
<< ex.minor() << endl << endl;
            bRetry = !bRetry;
        }
        catch(CORBA::COMM_FAILURE&)
        {
            tcout << endl << _T("Caught system exception COMM_FAILURE -- 
unable to contact the object!") << endl << endl;
            bRetry = !bRetry;
        }
        catch(CORBA::SystemException&)
        {
            tcout << endl << _T("Caught a CORBA::SystemException!") << 
endl << endl;
            bRetry = false;
        }
        catch(CORBA::Exception&)
        {
            tcout << endl << _T("Caught CORBA::Exception!") << endl << endl;
        }
        catch(omniORB::fatalException& fe)
        {
            tcout << endl << _T("Caught omniORB::fatalException:") << 
endl << endl;
            cout  << " file: " << fe.file() << endl
                  << " line: " << fe.line() << endl
                  << " mesg: " << fe.errmsg() << endl;
        }
        catch(...)
        {
            cout << _T("Unknown exception caught!") << endl << endl;
        }
//    } while (bRetry);

    return nStatus;
}

Regards,

-- 
*****************************************************
Vladislav Vrtunski
DMS Group
http://www.dmsgroup.co.yu/
***************************************************** 




More information about the omniORB-list mailing list