diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2005-03-04 17:44:10 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2005-03-04 17:44:10 +0000 |
commit | 49aa2cd64ae82c7d36c30ff2f77ed76810025b1b (patch) | |
tree | 9869eb82b74723e667ee9a7274b8e68aa9830773 | |
parent | 69603a17be6d5b0fe4c473ae8fcb6a49db1b9b3b (diff) | |
download | ATCD-49aa2cd64ae82c7d36c30ff2f77ed76810025b1b.tar.gz |
ChangeLogTag:Fri Mar 04 09:26:46 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 31 | ||||
-rw-r--r-- | TAO/tao/Collocated_Invocation.cpp | 12 | ||||
-rw-r--r-- | TAO/tao/Invocation_Adapter.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Object_Adapter.cpp | 17 |
4 files changed, 59 insertions, 7 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index f2930fba9c9..b53f7d9272e 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,34 @@ +Fri Mar 04 09:26:46 2005 Ossama Othman <ossama@dre.vanderbilt.edu> + + * tao/Collocated_Invocation.cpp (invoke): + + Perform thru-POA collocated invocations through the servant + ORB. The client code will otherwise not be able to find the + servant in applications that use multiple ORBs. Addresses a + regression that occured after the skeleton-refactor branch + merge. Thanks to Johnny for tracking down the problem and + suggesting a fix. [Bug 2055] + + Increment the reference count on the servant ORB_Core prior to + dispatching the request in the thru-POA collocation case. + Ownership of the servant ORB_Core must be retained for the + duration of the request in case another thread attempts to + destroy it (e.g. via CORBA::ORB::destroy()) before the thread + that initiated the request completes the invocation. Fixes a + race condition. [Bug 2055] + + * tao/Invocation_Adapter.cpp (invoke): + + In addition to the existing collocation proxy broker collocation + test, determine if collocation is viable by checking if the + object reference contains a valid pointer to a servant. + Collocation proxy brokers should be phased out soon. + + * tao/PortableServer/Object_Adapter.cpp (dispatch_servant): + + Call Servant_Upcall::pre_invoke_collocated_request() in the + collocated case, not pre_invoke_remote_request(). + Fri Mar 4 15:40:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl> * TAO_IDL/fe/fe_lookup.cpp: diff --git a/TAO/tao/Collocated_Invocation.cpp b/TAO/tao/Collocated_Invocation.cpp index 6c3f17b6f1b..52ef23d2b0b 100644 --- a/TAO/tao/Collocated_Invocation.cpp +++ b/TAO/tao/Collocated_Invocation.cpp @@ -3,6 +3,7 @@ #include "ORB_Core.h" #include "Request_Dispatcher.h" #include "TAO_Server_Request.h" +#include "Stub.h" #include "operation_details.h" @@ -48,7 +49,9 @@ namespace TAO { if (strat == TAO_CS_THRU_POA_STRATEGY) { - TAO_ORB_Core * const orb_core = this->orb_core (); + // Perform invocations on the servant through the servant's ORB. + CORBA::ORB_var servant_orb = this->stub ()->servant_orb_ptr (); + TAO_ORB_Core * const orb_core = servant_orb->orb_core (); TAO_ServerRequest request (orb_core, this->details_, @@ -57,6 +60,13 @@ namespace TAO TAO_Request_Dispatcher * const dispatcher = orb_core->request_dispatcher (); + // Retain ownership of the servant's ORB_Core in case + // another thread attempts to destroy it (e.g. via + // CORBA::ORB::destroy()) before this thread complete the + // invocation. + orb_core->_incr_refcnt (); + TAO_ORB_Core_Auto_Ptr my_orb_core (orb_core); + dispatcher->dispatch (orb_core, request, this->forwarded_to_.out () diff --git a/TAO/tao/Invocation_Adapter.cpp b/TAO/tao/Invocation_Adapter.cpp index 7968b28b72a..5b6a003b07c 100644 --- a/TAO/tao/Invocation_Adapter.cpp +++ b/TAO/tao/Invocation_Adapter.cpp @@ -68,8 +68,10 @@ namespace TAO Collocation_Strategy strat = TAO_CS_REMOTE_STRATEGY; // If we have a collocated proxy broker we look if we maybe - // can use a collocated invocation. - if (cpb_ != 0) + // can use a collocated invocation. Similarly, if the + // target object reference contains a pointer to a servant, + // the object reference also refers to a collocated object. + if (cpb_ != 0 || effective_target->_servant () != 0) { strat = TAO_ORB_Core::collocation_strategy (effective_target.in () diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index dd498fc8258..91b56afd6fd 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -339,10 +339,19 @@ TAO_Object_Adapter::dispatch_servant (const TAO::ObjectKey &key, if (result != TAO_Adapter::DS_OK) return result; - // Preprocess remote request. - servant_upcall.pre_invoke_remote_request (req - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (result); + // Preprocess request. + if (req.collocated ()) + { + servant_upcall.pre_invoke_collocated_request ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (result); + } + else + { + servant_upcall.pre_invoke_remote_request (req + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (result); + } // Servant dispatch. { |