diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-11-12 08:57:55 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-11-12 08:57:55 +0000 |
commit | 89cdcc3cda27b8615449f01d7f1e9190734cce54 (patch) | |
tree | 61369590e2f8aeedce2c5a66d1110e7af9d6db09 | |
parent | c060defb6cd92a1fd02a65496c88c652b56c19af (diff) | |
download | ATCD-89cdcc3cda27b8615449f01d7f1e9190734cce54.tar.gz |
Mon Nov 12 08:54:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | TAO/ChangeLog | 68 | ||||
-rw-r--r-- | TAO/tao/DynamicInterface/DII_Invocation.cpp | 22 | ||||
-rw-r--r-- | TAO/tao/DynamicInterface/DII_Invocation.h | 9 | ||||
-rw-r--r-- | TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp | 9 | ||||
-rw-r--r-- | TAO/tao/Invocation_Adapter.cpp | 49 | ||||
-rw-r--r-- | TAO/tao/Messaging/Asynch_Invocation.cpp | 44 | ||||
-rw-r--r-- | TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp | 14 | ||||
-rw-r--r-- | TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp | 3 | ||||
-rw-r--r-- | TAO/tao/Remote_Invocation.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/Remote_Invocation.h | 3 | ||||
-rw-r--r-- | TAO/tao/Synch_Invocation.cpp | 61 | ||||
-rw-r--r-- | TAO/tao/Synch_Invocation.h | 3 | ||||
-rw-r--r-- | TAO/tao/TransportCurrent/IIOP_Current_Impl.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/Utils/ORB_Manager.cpp | 4 | ||||
-rwxr-xr-x | TAO/tests/Portable_Interceptors/Bug_3079/run_test.pl | 13 | ||||
-rw-r--r-- | TAO/tests/TransportCurrent/Framework/Current_Test_Impl.cpp | 18 | ||||
-rw-r--r-- | TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.cpp | 20 | ||||
-rw-r--r-- | TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.h | 1 |
18 files changed, 243 insertions, 110 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 57321933229..ed721c64d8b 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,71 @@ +Mon Nov 12 08:54:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + Changed the way how portable interceptors relate to connection + establishment. A few years ago the connection was setup after the + send_request client interceptor call, this was changed with some + refactoring. The send_request was now called after the connection + establishment, as a result, if the connection establishment failed, + the receive_exception method on the client request interceptor + wasn't called. With this behaviour it is not possible to implement + a FT app with just interceptors, you need a TAO specific endpoint + selector. The change I made is to move the connection establishment + after the send_request. As a result in the send_request it can + happen that there is no transport selected, at that moment + retrieving transport current (which is TAO specific) will give a + NoContext exception. + + This fixes bugzilla 2133, 3079, and 3080. Thanks to Simon McQueen + and Jaiganesh Balasubramanian for reporting these issues. + + * tao/Synch_Invocation.cpp: + * tao/Synch_Invocation.h: + * tao/Messaging/Asynch_Invocation.cpp: + Moved the resolve on the profile_transport_resolver to after the + send_request. At the moment a transport has been selected the + virtual method transport_resolved() is called so that derived + classes can set additional values on the transport. + + * tao/Remote_Invocation.{h,cpp} (write_header): + Setup TAO_Target_Specification within this method, no need to + pass it in as argument + + * tao/DynamicInterface/DII_Invocation.{h,cpp}: + Use the new transport_resolved to set the transport in the safe_rd and + reset the byter order, at the moment the remote_invocation is called + it is possible that the transport is not resolved yet + + * tao/DynamicInterface/DII_Invocation_Adapter.cpp: + Don't reset the byte order here, do that in DII_Invocation + + * tao/Invocation_Adapter.cpp: + Const changes, layout changes and don't resolve the transport here, + do that in the Remote_Invocation derived classes + + * tao/Messaging/Asynch_Invocation_Adapter.cpp: + Don't schedule the timer here, but in the Async_Invocation because we + maybe haven't resolved the transport. + + * tao/TransportCurrent/IIOP_Current_Impl.cpp: + When we have no transport or no connection handler return a NoContext + instead of No_Implement + + * tao/Object.cpp: + Fixed typo in comment + + * tests/TransportCurrent/Framework/Current_Test_Impl.cpp: + * tests/TransportCurrent/lib/Client_Request_Interceptor.cpp: + * tests/TransportCurrent/lib/Client_Request_Interceptor.h: + Updated for the fact that send_request could throw NoContext + + * tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp: + Layout changes + + * tao/Utils/ORB_Manager.cpp: + Destroy the ORB in the destructor + + * tests/Portable_Interceptors/Bug_3079/run_test.pl: + Small updates + Mon Nov 12 08:12:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> * tests/Bug_2234_Regression/run_test.pl: diff --git a/TAO/tao/DynamicInterface/DII_Invocation.cpp b/TAO/tao/DynamicInterface/DII_Invocation.cpp index 1c24576d764..99a4c46358b 100644 --- a/TAO/tao/DynamicInterface/DII_Invocation.cpp +++ b/TAO/tao/DynamicInterface/DII_Invocation.cpp @@ -17,6 +17,8 @@ #include "tao/Profile_Transport_Resolver.h" #include "tao/ORB_Constants.h" #include "tao/SystemException.h" +#include "tao/Transport.h" +#include "tao/GIOP_Message_Base.h" #include "ace/OS_NS_string.h" @@ -83,6 +85,15 @@ namespace TAO return Synch_Twoway_Invocation::remote_twoway (max_wait_time); } + void + DII_Invocation::transport_resolved (void) + { + Synch_Twoway_Invocation::transport_resolved (); + + this->resolver_.transport ()->messaging_object ()->out_stream ().reset_byte_order ( + host_->_tao_byte_order ()); + } + Invocation_Status DII_Invocation::handle_user_exception (TAO_InputCDR &cdr) { @@ -207,9 +218,18 @@ namespace TAO Invocation_Status DII_Deferred_Invocation::remote_invocation (ACE_Time_Value *max_wait_time) { + return Asynch_Remote_Invocation::remote_invocation (max_wait_time); + } + + void + DII_Deferred_Invocation::transport_resolved (void) + { + Asynch_Remote_Invocation::transport_resolved (); + this->safe_rd_->transport (this->resolver_.transport ()); - return Asynch_Remote_Invocation::remote_invocation (max_wait_time); + this->resolver_.transport ()->messaging_object ()->out_stream ().reset_byte_order ( + host_->_tao_byte_order ()); } } diff --git a/TAO/tao/DynamicInterface/DII_Invocation.h b/TAO/tao/DynamicInterface/DII_Invocation.h index 373d6058500..93abab1f579 100644 --- a/TAO/tao/DynamicInterface/DII_Invocation.h +++ b/TAO/tao/DynamicInterface/DII_Invocation.h @@ -60,6 +60,10 @@ namespace TAO Invocation_Status remote_invocation (ACE_Time_Value *max_wait_time); virtual Invocation_Status handle_user_exception (TAO_InputCDR &cdr); + + protected: + virtual void transport_resolved (void); + private: CORBA::ExceptionList *excp_list_; @@ -88,11 +92,12 @@ namespace TAO Invocation_Status remote_invocation (ACE_Time_Value *max_wait_time); - private: + protected: + virtual void transport_resolved (void); + private: /// Back pointer to the DII request that created us. CORBA::Request_ptr host_; - }; /** diff --git a/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp b/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp index 744ff1a11f8..a0c44b8d5ef 100644 --- a/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp +++ b/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp @@ -9,8 +9,6 @@ #include "tao/ORB_Constants.h" #include "tao/Profile_Transport_Resolver.h" #include "tao/Transport.h" -#include "tao/Transport.h" -#include "tao/GIOP_Message_Base.h" #include "tao/SystemException.h" #include "tao/operation_details.h" @@ -87,16 +85,12 @@ namespace TAO CORBA::COMPLETED_NO); } - r.transport ()->messaging_object ()->out_stream ().reset_byte_order ( - request_->_tao_byte_order ()); - TAO::DII_Invocation synch (this->target_, r, op, this->exception_list_, this->request_); - Invocation_Status status = synch.remote_invocation (max_wait_time); if (status == TAO_INVOKE_RESTART && synch.is_forwarded ()) @@ -194,7 +188,6 @@ namespace TAO CORBA::COMPLETED_NO); } - r.transport ()->messaging_object ()->out_stream ().reset_byte_order (request_->_tao_byte_order ()); TAO::DII_Deferred_Invocation synch ( this->target_, r, @@ -202,8 +195,6 @@ namespace TAO this->rd_, this->request_); - r.transport ()->messaging_object ()->out_stream ().reset_byte_order (request_->_tao_byte_order ()); - Invocation_Status status = synch.remote_invocation (max_wait_time); if (status == TAO_INVOKE_RESTART) diff --git a/TAO/tao/Invocation_Adapter.cpp b/TAO/tao/Invocation_Adapter.cpp index 8375055e311..26f124c23d2 100644 --- a/TAO/tao/Invocation_Adapter.cpp +++ b/TAO/tao/Invocation_Adapter.cpp @@ -9,7 +9,6 @@ #include "tao/debug.h" #include "tao/Collocated_Invocation.h" #include "tao/Transport.h" -#include "tao/Transport_Mux_Strategy.h" #include "tao/Collocation_Proxy_Broker.h" #include "tao/GIOP_Utils.h" #include "tao/TAOC.h" @@ -67,8 +66,7 @@ namespace TAO // Initial state TAO::Invocation_Status status = TAO_INVOKE_START; - while (status == TAO_INVOKE_START || - status == TAO_INVOKE_RESTART) + while (status == TAO_INVOKE_START || status == TAO_INVOKE_RESTART) { // Default we go to remote Collocation_Strategy strat = TAO_CS_REMOTE_STRATEGY; @@ -232,7 +230,7 @@ namespace TAO (void) this->set_response_flags (stub, details); - CORBA::Octet rflags = details.response_flags (); + CORBA::Octet const rflags = details.response_flags (); bool const block_connect = rflags != static_cast<CORBA::Octet> (Messaging::SYNC_NONE) && rflags != static_cast<CORBA::Octet> (TAO::SYNC_DELAYED_BUFFERING); @@ -244,35 +242,24 @@ namespace TAO stub, block_connect); - resolver.resolve (max_wait_time); - - if (TAO_debug_level) + switch (this->type_) { - if (is_timeout && *max_wait_time == ACE_Time_Value::zero) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t)Invocation_Adapter::invoke_remote_i: ") - ACE_TEXT ("max wait time consumed during transport resolution\n"))); - } - - - // Update the request id now that we have a transport - details.request_id (resolver.transport ()->tms ()->request_id ()); + case TAO_ONEWAY_INVOCATION: + { + return this->invoke_oneway (details, + effective_target, + resolver, + max_wait_time); + } + case TAO_TWOWAY_INVOCATION: + { + return this->invoke_twoway (details, + effective_target, + resolver, + max_wait_time); - if (this->type_ == TAO_ONEWAY_INVOCATION) - { - return this->invoke_oneway (details, - effective_target, - resolver, - max_wait_time); - } - else if (this->type_ == TAO_TWOWAY_INVOCATION) - { - return this->invoke_twoway (details, - effective_target, - resolver, - max_wait_time); + } } - return TAO_INVOKE_FAILURE; } @@ -370,8 +357,6 @@ namespace TAO TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE, errno), CORBA::COMPLETED_NO); - - return; } } // End namespace TAO diff --git a/TAO/tao/Messaging/Asynch_Invocation.cpp b/TAO/tao/Messaging/Asynch_Invocation.cpp index ef635284df1..77a13a3ca5c 100644 --- a/TAO/tao/Messaging/Asynch_Invocation.cpp +++ b/TAO/tao/Messaging/Asynch_Invocation.cpp @@ -41,12 +41,6 @@ namespace TAO Invocation_Status Asynch_Remote_Invocation::remote_invocation (ACE_Time_Value *max_wait_time) { - TAO_Target_Specification tspec; - this->init_target_spec (tspec); - - TAO_OutputCDR & cdr = - this->resolver_.transport ()->messaging_object ()->out_stream (); - Invocation_Status s = TAO_INVOKE_FAILURE; #if TAO_HAS_INTERCEPTORS == 1 @@ -61,6 +55,38 @@ namespace TAO try { #endif /* TAO_HAS_INTERCEPTORS */ + bool const is_timeout = max_wait_time && (*max_wait_time != ACE_Time_Value::zero); + + this->resolver_.resolve (max_wait_time); + + if (TAO_debug_level) + { + if (is_timeout && max_wait_time && *max_wait_time == ACE_Time_Value::zero) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) Asynch_Remote_Invocation::remote_invocation: ") + ACE_TEXT ("max wait time consumed during transport resolution\n"))); + } + + // Callback that the transport has been resolved. Derived classes + // can now use the transport if they need to + this->transport_resolved (); + + TAO_Transport* const transport = this->resolver_.transport (); + + if (this->safe_rd_.get ()) + { + this->safe_rd_->transport (transport); + // AMI Timeout Handling Begin + ACE_Time_Value tmp; + + if (is_timeout) + { + this->safe_rd_->schedule_timer (this->details_.request_id (), *max_wait_time); + } + } + + TAO_OutputCDR & cdr = + this->resolver_.transport ()->messaging_object ()->out_stream (); // Oneway semantics. See comments for below send_message() // call. @@ -69,7 +95,7 @@ namespace TAO TAO_Transport::TAO_ONEWAY_REQUEST, max_wait_time); - this->write_header (tspec, cdr); + this->write_header (cdr); this->marshal_data (cdr); @@ -78,7 +104,7 @@ namespace TAO TAO_Bind_Dispatcher_Guard dispatch_guard ( this->details_.request_id (), this->safe_rd_.get (), - this->resolver_.transport ()->tms ()); + transport->tms ()); // Now that we have bound the reply dispatcher to the map, just // loose ownership of the reply dispatcher. @@ -132,7 +158,7 @@ namespace TAO // NOTE: Not sure how things are handles with exclusive muxed // strategy. - if (this->resolver_.transport ()->idle_after_send ()) + if (transport->idle_after_send ()) (void) this->resolver_.transport_released (); #if TAO_HAS_INTERCEPTORS == 1 diff --git a/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp b/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp index b52785566d8..3a26fdc8744 100644 --- a/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp +++ b/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp @@ -170,20 +170,6 @@ namespace TAO CORBA::COMPLETED_NO); } - if (this->safe_rd_.get ()) - { - // Cache the transport in the reply dispatcher - this->safe_rd_->transport (r.transport ()); - - // AMI Timeout Handling Begin - ACE_Time_Value tmp; - - if (this->get_timeout (r.stub (), tmp)) - { - this->safe_rd_->schedule_timer (op.request_id (), *max_wait_time); - } - } - // Loose ownership of the reply dispatcher TAO::Asynch_Remote_Invocation asynch ( effective_target.in (), diff --git a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp index 78b973c67fb..6dffcaa45b2 100644 --- a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp +++ b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp @@ -60,8 +60,7 @@ namespace TAO CORBA::Object_ptr ObjectReferenceTemplate::make_object ( const char *, - const PortableInterceptor::ObjectId & - ) + const PortableInterceptor::ObjectId &) { if (CORBA::is_nil (this->poa_.in ())) throw ::CORBA::BAD_INV_ORDER (); diff --git a/TAO/tao/Remote_Invocation.cpp b/TAO/tao/Remote_Invocation.cpp index 8659724739e..87c5e625f9d 100644 --- a/TAO/tao/Remote_Invocation.cpp +++ b/TAO/tao/Remote_Invocation.cpp @@ -99,9 +99,11 @@ namespace TAO } void - Remote_Invocation::write_header (TAO_Target_Specification &spec, - TAO_OutputCDR &out_stream) + Remote_Invocation::write_header (TAO_OutputCDR &out_stream) { + TAO_Target_Specification spec; + this->init_target_spec (spec); + this->resolver_.transport ()->clear_translators (0, &out_stream); // Send the request for the header @@ -142,7 +144,7 @@ namespace TAO if (nph != 0) { // nph = 0, means DiffServ library is not used - // nph = 0, means DiffServ library is used, and + // nph = 0, means DiffServ library is used, and // request DSCP and reply DSCP are set. // Note that the application could still be using // RTCORBA, but still setting DIffServ codepoints diff --git a/TAO/tao/Remote_Invocation.h b/TAO/tao/Remote_Invocation.h index ce45b946d6b..c274471b421 100644 --- a/TAO/tao/Remote_Invocation.h +++ b/TAO/tao/Remote_Invocation.h @@ -68,8 +68,7 @@ namespace TAO void init_target_spec (TAO_Target_Specification &spec); /// Write the GIOP header into the stream. - void write_header (TAO_Target_Specification &spec, - TAO_OutputCDR &out_stream); + void write_header (TAO_OutputCDR &out_stream); /// Marshal the arguments into the stream. void marshal_data (TAO_OutputCDR &cdr); diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp index 2031d848c2d..15fe92b4e4d 100644 --- a/TAO/tao/Synch_Invocation.cpp +++ b/TAO/tao/Synch_Invocation.cpp @@ -15,6 +15,7 @@ #include "tao/ORB_Core.h" #include "tao/Service_Context.h" #include "tao/SystemException.h" +#include "tao/Transport_Mux_Strategy.h" #if TAO_HAS_INTERCEPTORS == 1 # include "tao/PortableInterceptorC.h" @@ -58,9 +59,6 @@ namespace TAO TAO_Synch_Reply_Dispatcher rd (this->resolver_.stub ()->orb_core (), this->details_.reply_service_info ()); - TAO_Target_Specification tspec; - this->init_target_spec (tspec); - Invocation_Status s = TAO_INVOKE_FAILURE; #if TAO_HAS_INTERCEPTORS == 1 @@ -76,15 +74,32 @@ namespace TAO try { #endif /*TAO_HAS_INTERCEPTORS */ + bool const is_timeout = max_wait_time && (*max_wait_time != ACE_Time_Value::zero); + + this->resolver_.resolve (max_wait_time); + + if (TAO_debug_level) + { + if (is_timeout && max_wait_time && *max_wait_time == ACE_Time_Value::zero) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) Synch_Oneway_Invocation::remote_twoway: ") + ACE_TEXT ("max wait time consumed during transport resolution\n"))); + } - TAO_OutputCDR &cdr = this->resolver_.transport ()->out_stream (); + // Callback that the transport has been resolved. Derived classes + // can now use the transport if they need to + this->transport_resolved (); + + TAO_Transport* const transport = this->resolver_.transport (); + + TAO_OutputCDR &cdr = transport->out_stream (); cdr.message_attributes (this->details_.request_id (), this->resolver_.stub (), TAO_Transport::TAO_TWOWAY_REQUEST, max_wait_time); - this->write_header (tspec, cdr); + this->write_header (cdr); this->marshal_data (cdr); @@ -93,13 +108,13 @@ namespace TAO TAO_Bind_Dispatcher_Guard dispatch_guard ( this->details_.request_id (), &rd, - this->resolver_.transport ()->tms ()); + transport->tms ()); if (dispatch_guard.status () != 0) { // @@ What is the right way to handle this error? Why should // we close the connection? - this->resolver_.transport ()->close_connection (); + transport->close_connection (); throw ::CORBA::INTERNAL (0, CORBA::COMPLETED_NO); } @@ -132,7 +147,7 @@ namespace TAO // For some strategies one may want to release the transport // back to cache. If the idling is successfull let the // resolver about that. - if (this->resolver_.transport ()->idle_after_send ()) + if (transport->idle_after_send ()) this->resolver_.transport_released (); // @@ In all MT environments, there's a cancellation point lurking @@ -175,7 +190,7 @@ namespace TAO // For some strategies one may want to release the transport // back to cache after receiving the reply. - if (this->resolver_.transport ()->idle_after_reply ()) + if (transport->idle_after_reply ()) this->resolver_.transport_released (); #if TAO_HAS_INTERCEPTORS == 1 @@ -238,7 +253,7 @@ namespace TAO int const reply_error = this->resolver_.transport ()->wait_strategy ()->wait (max_wait_time, rd); - if (TAO_debug_level > 0 && max_wait_time != 0) + if (TAO_debug_level > 0 && max_wait_time) { CORBA::ULong const msecs = max_wait_time->msec (); @@ -595,6 +610,12 @@ namespace TAO return TAO_INVOKE_SYSTEM_EXCEPTION; } + void Synch_Twoway_Invocation::transport_resolved (void) + { + // Update the request id now that we have a transport + this->details_.request_id (this->resolver_.transport ()->tms ()->request_id ()); + } + // ========================================================================= Synch_Oneway_Invocation::Synch_Oneway_Invocation ( @@ -622,9 +643,6 @@ namespace TAO return s; } - TAO_Target_Specification tspec; - this->init_target_spec (tspec); - #if TAO_HAS_INTERCEPTORS == 1 s = this->send_request_interception (); @@ -634,6 +652,21 @@ namespace TAO try { #endif /*TAO_HAS_INTERCEPTORS */ + bool const is_timeout = max_wait_time && (*max_wait_time != ACE_Time_Value::zero); + + this->resolver_.resolve (max_wait_time); + + if (TAO_debug_level) + { + if (is_timeout && max_wait_time && *max_wait_time == ACE_Time_Value::zero) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) Synch_Oneway_Invocation::remote_oneway: ") + ACE_TEXT ("max wait time consumed during transport resolution\n"))); + } + + // Callback that the transport has been resolved. Derived classes + // can now use the transport if they need to + this->transport_resolved (); TAO_Transport* const transport = this->resolver_.transport (); @@ -644,7 +677,7 @@ namespace TAO TAO_Transport::TAO_ONEWAY_REQUEST, max_wait_time); - this->write_header (tspec, cdr); + this->write_header (cdr); this->marshal_data (cdr); diff --git a/TAO/tao/Synch_Invocation.h b/TAO/tao/Synch_Invocation.h index 58aa96774c6..b731de9e040 100644 --- a/TAO/tao/Synch_Invocation.h +++ b/TAO/tao/Synch_Invocation.h @@ -107,6 +107,9 @@ namespace TAO TAO_Synch_Reply_Dispatcher &rd, TAO_Bind_Dispatcher_Guard &bd); + /// Callback when the transport resolver has resolved a transport + virtual void transport_resolved (void); + private: /// Helper method that checks the reply status of the diff --git a/TAO/tao/TransportCurrent/IIOP_Current_Impl.cpp b/TAO/tao/TransportCurrent/IIOP_Current_Impl.cpp index fa49fcf0104..4576c973a22 100644 --- a/TAO/tao/TransportCurrent/IIOP_Current_Impl.cpp +++ b/TAO/tao/TransportCurrent/IIOP_Current_Impl.cpp @@ -30,11 +30,11 @@ namespace TAO #if defined (TAO_HAS_IIOP) && (TAO_HAS_IIOP != 0) const TAO_Transport* t = this->transport (); if (t == 0) - throw ::CORBA::NO_IMPLEMENT (); + throw NoContext (); TAO_Connection_Handler *ch = const_cast<TAO_Transport*>(t)->connection_handler (); if (ch == 0) - throw ::CORBA::NO_IMPLEMENT (); + throw NoContext (); return dynamic_cast <TAO_IIOP_Connection_Handler*> (ch); #else diff --git a/TAO/tao/Utils/ORB_Manager.cpp b/TAO/tao/Utils/ORB_Manager.cpp index 5776a957e1c..4ab7af28e56 100644 --- a/TAO/tao/Utils/ORB_Manager.cpp +++ b/TAO/tao/Utils/ORB_Manager.cpp @@ -254,6 +254,10 @@ TAO_ORB_Manager::~TAO_ORB_Manager (void) { this->poa_->destroy (1,1); } + if (!CORBA::is_nil (this->orb_.in ())) + { + this->orb_->destroy (); + } } catch (const ::CORBA::Exception&) { diff --git a/TAO/tests/Portable_Interceptors/Bug_3079/run_test.pl b/TAO/tests/Portable_Interceptors/Bug_3079/run_test.pl index 57b11e609a4..95f3e027d2d 100755 --- a/TAO/tests/Portable_Interceptors/Bug_3079/run_test.pl +++ b/TAO/tests/Portable_Interceptors/Bug_3079/run_test.pl @@ -10,7 +10,8 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; -$file1 = PerlACE::LocalFile ("test1.ior"); +$file1base = "test1.ior"; +$file1 = PerlACE::LocalFile ("$file1base"); $file2 = PerlACE::LocalFile ("test2.ior"); $file3 = PerlACE::LocalFile ("test3.ior"); @@ -19,7 +20,7 @@ unlink $file2; unlink $file3; if (PerlACE::is_vxworks_test()) { -$SV1 = new PerlACE::ProcessVX ("server", "-o test1.ior -c 1 -n 1"); +$SV1 = new PerlACE::ProcessVX ("server", "-o $file1base -c 1 -n 1"); } else { $SV1 = new PerlACE::Process ("server", "-o $file1 -c 1 -n 1 -s 1"); @@ -31,7 +32,7 @@ $CL = new PerlACE::Process ("client", $status = 0; -print STDERR "\n\n==== Running PortableInterceptor::Redirection test\n"; +print STDERR "\n\n==== Running PortableInterceptor::Bug_3079 test\n"; $SV1->Spawn (); $SV2->Spawn (); @@ -62,7 +63,7 @@ if ($client != 0) { $status = 1; } -$server1 = $SV1->WaitKill (5); +$server1 = $SV1->WaitKill (15); # The first server will crash by design and in such instance it will # return the magic number 1. The test must not interpret it as an @@ -78,7 +79,7 @@ if ($server1 != 0) { } } -$server2 = $SV2->WaitKill (5); +$server2 = $SV2->WaitKill (15); # The second server will crash by design and in such instance it will # return the magic number 1. The test must not interpret it as an @@ -93,7 +94,7 @@ if ($server2 != 0) { } } -$server3 = $SV3->WaitKill (5); +$server3 = $SV3->WaitKill (15); if ($server3 != 0) { print STDERR "ERROR: server3 returned $server3\n"; diff --git a/TAO/tests/TransportCurrent/Framework/Current_Test_Impl.cpp b/TAO/tests/TransportCurrent/Framework/Current_Test_Impl.cpp index b0cdb5507ea..0697c11ac4c 100644 --- a/TAO/tests/TransportCurrent/Framework/Current_Test_Impl.cpp +++ b/TAO/tests/TransportCurrent/Framework/Current_Test_Impl.cpp @@ -30,10 +30,11 @@ Current_Test_Impl::self_test (void) void Current_Test_Impl::test_transport_current (void) { - if (TAO_debug_level > 2) { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) server - Testing access to Transport Current ...\n"))); - } + if (TAO_debug_level > 2) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) server - Testing access to Transport Current ...\n"))); + } CORBA::Object_var tcobject = orb_->resolve_initial_references ("TAO::Transport::Current"); @@ -62,10 +63,11 @@ Current_Test_Impl::test_transport_current (void) (ACE_UINT64)rr)); } - if (TAO_debug_level > 2) { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) server - Successfully accessed Transport Current\n"))); - } + if (TAO_debug_level > 2) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) server - Successfully accessed Transport Current\n"))); + } } void diff --git a/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.cpp b/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.cpp index 5a84ba9b191..4e897780b5c 100644 --- a/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.cpp +++ b/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.cpp @@ -9,6 +9,8 @@ ACE_RCSID (ForwardRequest, #include "Current_TestC.h" #include "Client_Request_Interceptor.h" #include "Client_ORBInitializer.h" +#include "Client_ORBInitializer.h" +#include "tao/TransportCurrent/TC_IIOPC.h" namespace Test { @@ -65,10 +67,18 @@ namespace Test void Client_Request_Interceptor::send_request (PortableInterceptor::ClientRequestInfo_ptr ri) { - //Test TC - test_transport_current ("send_request"); - - CORBA::Boolean response_expected = + // Test TC, first invocation doesn't have a TC + try + { + test_transport_current ("send_request"); + } + catch (const TAO::Transport::NoContext&) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT("CRI (%P|%t) Got no context\n"))); + // ignore + } + + CORBA::Boolean const response_expected = ri->response_expected (); // Oneway? @@ -87,7 +97,7 @@ namespace Test ACE_GUARD (TAO_SYNCH_MUTEX, monitor, this->lock_); ACE_OS::sprintf (temp, "%d", this->requestID_); - this->requestID_++; + ++this->requestID_; } CORBA::ULong string_len = ACE_OS::strlen (temp) + 1; diff --git a/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.h b/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.h index 6e9d34ae9b9..148b8075c8e 100644 --- a/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.h +++ b/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.h @@ -78,7 +78,6 @@ namespace Test virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri); - virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri); virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri); |