[jacorb-developer] JACORB CORBA call did not timeout when made on TAO server that was just initializing

Alka Nand alka.nand at gmail.com
Tue Apr 8 17:03:01 CEST 2014


I am running JACORB 3.0 and my jacorb client pings the TAO server every 4
minutes. This particular "narrow" may have coincided with a restart of the
TAO server in which it may not have properly initialized. The TAO server
finished initializing and seemed to be in a good state but the call did not
timeout. The thread was stuck on that call. I then reset the TAO server and
that caused the call to finally bail out with a  COMM_FAILURE. I am also
copying the code I have for setting up the timeout. I have the timeout set
for 1 minute.

Any help is very much appreciate

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err: 2014-04-07 16:55:32.577
SEVERE Failed to write GIOP message due to COMM_FAILURE, in
ClientGIOPConnection
to 172.28.xx.xx:1632 (19181ae)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.jacorb.orb.etf.ConnectionBase.to_COMM_FAILURE(ConnectionBase.java:152)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.jacorb.orb.iiop.IIOPConnection.handleCommFailure(IIOPConnection.java:79)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.jacorb.orb.etf.StreamConnectionBase.flush(StreamConnectionBase.java:228)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.jacorb.orb.giop.GIOPConnection.sendMessage(GIOPConnection.java:1062)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.jacorb.orb.giop.GIOPConnection.sendRequest(GIOPConnection.java:988)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:309)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:290)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.jacorb.orb.Delegate._invoke_internal(Delegate.java:1327)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.jacorb.orb.Delegate.invoke_internal(Delegate.java:1152)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.jacorb.orb.Delegate.invoke(Delegate.java:1140)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.jacorb.orb.Delegate.invokeBuiltin(Delegate.java:2031)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.jacorb.orb.Delegate.is_a(Delegate.java:1894)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:130)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
com.tellabs.ems.sb_if.emsne.SessionMgr.NESessionFactory_IHelper.narrow(NESessionFact

ory_IHelper.java:59)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
com.tellabs.ems.idlneadapter.EMSSession.establishSession(EMSSession.java:840)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
com.tellabs.ems.idlneadapter.IPTVNEMonitorThread.monitorNE(IPTVNEMonitorThread.java:

298)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
com.tellabs.ems.idlneadapter.IPTVNEMonitorThread.run(IPTVNEMonitorThread.java:134)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err:
java.lang.Thread.run(Thread.java:724)

Thread-72;Mon Apr 07 16:55:32 CDT 2014;System.err: 2014-04-07 16:55:32.596
SEVERE Underlying transport connection closed due to errors during
sendMessage(), in ClientGIOPConnection to 172.28.xx.xx:1632 (19181ae)


Code to set Timeout


                        long relativeExpiry = 60L * 10000000L; //60
seconds, 1 min

        //objref = _myORB.string_to_object("corbaloc:ssliop:1.2 at 172.28.xx.xx
:1632/NESessionFactory");

           tempObjref = _myORB.string_to_object("corbaloc:ssliop:1.2@"
+_ipAdd+":" +  _port + "/NESessionFactory");



                //Set RelativeRoundtripTimeoutPolicy


                objref = setTimeoutPolicy(tempObjref, relativeExpiry);



                neSessionFactory = NESessionFactory_IHelper.narrow(objref);




    private org.omg.CORBA.Object setTimeoutPolicy(org.omg.CORBA.Object
objref, long relativeExpiry)

    {

        //Set RelativeRoundtripTimeoutPolicy

        //This policy specifies how much time is allowed to deliver a
request and its reply.

        //This value is set in 100 nanosecond units. It does not have a
default value.

        //If it is not set, a request has unlimited time to complete.

    //1 millisec =(10000 units) since 1 unit is 100 ns

    //1 sec =  1000 * 10000 = 1000 millisec

    //Policy p = new
org.jacorb.orb.policies.RelativeRoundtripTimeoutPolicy(1000 * 10000);

        JDiagnostic.log("setTimeoutPolicy:: Timeout = " + relativeExpiry);

        org.omg.CORBA.Object newObjref = null;

        try

        {

          Any relativeRoundtripTimeoutValue = _myORB.create_any();

          TimeTHelper.insert(relativeRoundtripTimeoutValue, relativeExpiry);

          Policy[] policies = new Policy[1];

          policies[0] =
_myORB.create_policy(RELATIVE_RT_TIMEOUT_POLICY_TYPE.value,
relativeRoundtripTimeoutValue);



          newObjref = objref._set_policy_override(policies,
SetOverrideType.ADD_OVERRIDE);

        }

        catch(UserException ex)

        {

          //Catch InvalidPolicies, SystemException and PolicyError

          traceException("run() FAIL\t setting
RELATIVE_RT_TIMEOUT_POLICY_TYPE policy override on neSession Object: " +
ex);

          ex.printStackTrace();

          //Cannot throw an Exception so just Continue....

        }

        catch(Exception ex)

        {

          //Catch InvalidPolicies, SystemException and PolicyError

          traceException("run()General Exception FAIL\t setting
RELATIVE_RT_TIMEOUT_POLICY_TYPE policy override on neSession Object:" + ex);

          ex.printStackTrace();

          //Cannot throw an Exception so just Continue....

        }



        return newObjref;

    }


Thanks

alka nand

Staff Engineer

Tellabs


--


More information about the jacorb-developer mailing list