[omniORB] Binding context sometimes never returns

Jörg König J.Koenig at adg.de
Thu Nov 24 11:38:56 GMT 2016


Hello,

we setup small networks for our customers. A (Windows-)server and a few 
(Windows-)clients. An Omni-Name-Service is running on the server and 
windows-services using omniORB are running on each client.
We used omniORB 4.0.7 for several years without any problems.
Since we're using omniORB 4.1.7 we encounter some difficulties with one 
of the services running on a client computer. When it tries to bind a 
context to the root-context of the Name-Service, it hangs up (the line 
in he source code below is marked with --->) and never returns. 
Unfortunately it doesn't happen always and/or anywhere. There are 
customer-hosts where it happens very often up to always and others where 
it never happens - and we can't get our test-systems to reproduce it 
(and it's nearly impossible to inspect the hosts of our customers) :-\
The main difference of this service compared with other services is the 
use of "bidir" and "dyn_poa" POAs.
What I need to know is: are there known circumstances where this can happen?
What can we do to analyze the problem?

Comments and diagnostic-output lines are removed from the code:

bool CCorbaService::BindObjectToName(CORBA::Object_ptr obj, const char * 
ID, const char * Kind, bool bind) {
     try {
         CosNaming::NamingContext_var rootContext;

         try {
             CORBA::Object_var initServ;
             initServ = m_ORB->resolve_initial_references("NameService");

             rootContext = CosNaming::NamingContext::_narrow(initServ);
             if(CORBA::is_nil(rootContext)) {
                 cerr << "Failed to narrow naming context." << endl;
                 return false;
             }
         } catch(CORBA::ORB::InvalidName &) {
             return false;
         } catch(const CORBA::Exception &) {
             return false;
         }


         try {
             CosNaming::Name contextName;
             contextName.length(1);
             contextName[0].id   = (const char*) "adg";
             contextName[0].kind = (const char*) "the_adg_context";

             CosNaming::NamingContext_var testContext;
             try {
                 testContext = rootContext->bind_new_context(contextName);
             } catch(CosNaming::NamingContext::AlreadyBound &) {
                 CORBA::Object_var tmpobj;
                 tmpobj = rootContext->resolve(contextName);
                 testContext = CosNaming::NamingContext::_narrow(tmpobj);
                 if (CORBA::is_nil(testContext)) {
                     return false;
                 }
             }

             CosNaming::Name objectName;
             objectName.length(1);
             objectName[0].id   = ID;
             objectName[0].kind = Kind;

             try {
                 if(bind)
/* ---> */     testContext->bind(objectName,obj);        // this method 
never returns ... sometimes
                 else
                     testContext->unbind(objectName);
             } catch(CosNaming::NamingContext::AlreadyBound &) {
                 if(bind) {
                     testContext->rebind(objectName,obj);
                 }
             } catch(CosNaming::NamingContext::NotFound &) {
             }
         } catch (CORBA::COMM_FAILURE &) {
             return false;
         } catch (omniORB::fatalException &) {
             throw;
         }
     } catch (...) {
         return false;
     }
     return true;
}

-- 
Mail:    J.Koenig at adg.de
Company: ADG mbH, Mannheim Germany
Phone:   +49 0621/8505-609




More information about the omniORB-list mailing list