[omniORB] transient exception handler and call timeout problem

Vladislav Vrtunski vladislav.vrtunski at dmsgroup.co.yu
Wed Apr 20 14:02:58 BST 2005


Hi,

    We are trying to limit call duration to 2 seconds and if the timeout 
is reached we want to repeat the call, hoping that it won't last that 
long the second time. This is part of an attempt to make a fault 
tolerant system. In order to achieve that, we have set client call 
timeout and installed both transient and comm_failure exception 
handlers. Each of these handlers is written to allow ORB to retry the 
operation once in case exception occurs.
    Here is the problem. When the timeout is reached and 
TRANSIENT_CallTimedout exception is thrown, our transient exception 
handler is called and it returns 1 so that ORB repeats the call. 
Immediately after that TRANSIENT_ConnectFailed is thrown without server 
side method being called, although we can see in omniORB trace that the 
server has accepted the second connection from client. Is this the 
expected behavior? We would expect the second call to at least reach the 
server method.

Server side trace:

omniORB: Server accepted connection from giop:tcp:192.168.0.15:1695
omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 3
omniORB: Accepted connection from giop:tcp:192.168.0.15:1695 because of 
this rule: "* tcp"
omniORB: Handling a GIOP LOCATE_REQUEST.
omniORB: AsyncInvoker: thread id = 4 has started. Total threads = 4
omniORB: throw giopStream::CommFailure from 
giopStream.cc:831(0,NO,COMM_FAILURE_UnMarshalArguments)
omniORB: Server accepted connection from giop:tcp:192.168.0.15:1696
omniORB: Accepted connection from giop:tcp:192.168.0.15:1696 because of 
this rule: "* tcp"
omniORB: throw giopStream::CommFailure from 
giopStream.cc:831(0,NO,COMM_FAILURE_UnMarshalArguments)
omniORB: Server close connection from giop:tcp:192.168.0.15:1696
omniORB: Server close connection from giop:tcp:192.168.0.15:1695
omniORB: AsyncInvoker: thread id = 4 has exited. Total threads = 4
omniORB: AsyncInvoker: thread id = 3 has exited. Total threads = 3

Client side trace:

omniORB: LocateRequest to remote: root<0>
omniORB: Client opened connection to giop:tcp:192.168.0.16:1044
omniORB: throw giopStream::CommFailure from 
giopStream.cc:831(0,MAYBE,TRANSIENT_CallTimedout)
omniORB: Client close connection to giop:tcp:192.168.0.16:1044
Transient handler called. Retries = 0
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

Client code fragment:

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

//part of the main func
{
        ...
        omniORB::installCommFailureExceptionHandler(NULL, 
CommFailureHandler);
        omniORB::installTransientExceptionHandler(NULL, TransientHandler);
        CORBA::ULong ct = 2000;
        omniORB::setClientCallTimeout(ct);
        try
        {
            nStatus = pServer->GetStatus();
        }
        catch (CORBA::TRANSIENT& ex)
        {
            tcout << _T("TRANSIENT exception caught! Code = ") << 
ex.minor() << endl;
        }
        catch(CORBA::COMM_FAILURE&)
        {
            tcout << _T("Caught system exception COMM_FAILURE -- unable 
to contact the object!") << endl;
        }
        ...
}

We are using omniORB-4.0.5 on Win2k machines and VC++6.0 compiler.

Regards,

-- 
Vladislav Vrtunski
DMS Group
Serbia & Montenegro





More information about the omniORB-list mailing list