diff options
author | iliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-03-31 21:53:49 +0000 |
---|---|---|
committer | iliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-03-31 21:53:49 +0000 |
commit | 5ec8a9018635cf45c595181859d66f36db0c80ad (patch) | |
tree | 48926b91492e46f77b97a8669b2208fa34619654 | |
parent | a3019bb1c31de3d2d785a63b2c22273fb5dc9837 (diff) | |
download | ATCD-5ec8a9018635cf45c595181859d66f36db0c80ad.tar.gz |
Merged revisions 81175,81178 via svnmerge from
https://svn.dre.vanderbilt.edu/DOC/Middleware/trunk/TAO
........
r81175 | vzykov | 2008-03-31 11:19:46 -0500 (Mon, 31 Mar 2008) | 1 line
ChangeLogTag: Mon Mar 31 15:55:18 UTC 2008 Vladimir Zykov <vladimir.zykov@prismtech.com>
........
r81178 | johnc | 2008-03-31 13:26:45 -0500 (Mon, 31 Mar 2008) | 1 line
ChangeLogTag: Mon Mar 31 18:20:01 UTC 2008 Ciju John <johnc at ociweb dot com>
........
19 files changed, 99 insertions, 25 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 7126d7d0042..d51f8c34494 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,40 @@ +Mon Mar 31 18:20:01 UTC 2008 Ciju John <johnc at ociweb dot com> + + * tests/Oneway_Send_Timeouts/Client.cpp: + * tests/Oneway_Send_Timeouts/Server.cpp: + * tests/Oneway_Send_Timeouts/Server_Task.h: + * tests/Oneway_Send_Timeouts/Test_i.h: + * tests/Oneway_Send_Timeouts/Test_i.cpp: + * tests/Oneway_Send_Timeouts/main.cpp: + Thread cleanup fixes. + +Mon Mar 31 15:55:18 UTC 2008 Vladimir Zykov <vladimir.zykov@prismtech.com> + + * tao/GIOP_Message_Base.cpp: + * tao/PortableServer/PolicyS.cpp: + * tao/PortableServer/PolicyS.h: + * tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h: + * tao/PortableServer/Upcall_Wrapper.cpp: + * tao/PortableServer/Object_Adapter.cpp: + * tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp: + * tao/Collocation_Proxy_Broker.h: + * tao/Collocated_Invocation.cpp: + * tao/PI_Server/ServerInterceptorAdapter.cpp: + * TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp: + * TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp: + + Provided additional fix for Bug#2376. In particular added is_forwaded + argument to Collocation_Proxy_Broker::dispatch which will indicate a + forwarding case. Changed code generation in tao_idl according to the + new signature of that dispatch method. Also found another place in + Upcall_Wrapper.cpp that assumes that forwarding must be done if a + forward reference is not nil. And since TAO_ServerRequest has both + pi_reply_status and reply_status features added a code that set to + forwarding state each of them if only one changes. So, that if + reply_status is set GIOP::LOCATION_FORWARD then pi_reply_status + is set to PortableInterceptor::LOCATION_FORWARD immediately after + that. + Mon Mar 31 08:45:12 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> * configure.ac: diff --git a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp index f275be94303..fb0a68fe461 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp @@ -59,6 +59,7 @@ be_visitor_interface_strategized_proxy_broker_sh::visit_interface ( << "dispatch (" << be_idt << be_idt_nl << "::CORBA::Object_ptr obj," << be_nl << "::CORBA::Object_out forward_obj," << be_nl + << "bool & is_forwarded," << be_nl << "TAO::Argument ** args," << be_nl << "int num_args," << be_nl << "const char * op," << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp index 5014915c5aa..365fed1e16a 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp @@ -82,6 +82,7 @@ be_visitor_interface_strategized_proxy_broker_ss::visit_interface ( << "dispatch (" << be_idt << be_idt_nl << "::CORBA::Object_ptr obj," << be_nl << "::CORBA::Object_out forward_obj," << be_nl + << "bool & is_forwarded," << be_nl << "TAO::Argument ** args," << be_nl << "int num_args," << be_nl << "const char * op," << be_nl @@ -93,6 +94,7 @@ be_visitor_interface_strategized_proxy_broker_ss::visit_interface ( << "collocation_upcall_wrapper.upcall (" << be_idt_nl << "obj," << be_nl << "forward_obj," << be_nl + << "is_forwarded," << be_nl << "args," << be_nl << "num_args," << be_nl << "op," << be_nl diff --git a/TAO/tao/Collocated_Invocation.cpp b/TAO/tao/Collocated_Invocation.cpp index e5612502a93..1f6d06cc2bd 100644 --- a/TAO/tao/Collocated_Invocation.cpp +++ b/TAO/tao/Collocated_Invocation.cpp @@ -75,11 +75,14 @@ namespace TAO dispatcher->dispatch (orb_core, request, this->forwarded_to_.out ()); + + this->is_forwarded_ = request.is_forwarded (); } else { cpb->dispatch (this->effective_target (), this->forwarded_to_.out (), + this->is_forwarded_, this->details_.args (), this->details_.args_num (), this->details_.opname (), @@ -121,7 +124,7 @@ namespace TAO this->handle_any_exception (&ex); if (status == PortableInterceptor::LOCATION_FORWARD || - status == PortableInterceptor::TRANSPORT_RETRY) + status == PortableInterceptor::TRANSPORT_RETRY) s = TAO_INVOKE_RESTART; else #endif /* TAO_HAS_INTERCEPTORS */ diff --git a/TAO/tao/Collocation_Proxy_Broker.h b/TAO/tao/Collocation_Proxy_Broker.h index 301063f7d7b..e3c44b0be1a 100644 --- a/TAO/tao/Collocation_Proxy_Broker.h +++ b/TAO/tao/Collocation_Proxy_Broker.h @@ -58,6 +58,7 @@ namespace TAO virtual void dispatch (CORBA::Object_ptr obj, CORBA::Object_out forward_obj, + bool & is_forwarded, Argument ** args, int num_args, const char * op, diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index 56be7d9e437..3376fd4f414 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -1101,8 +1101,6 @@ TAO_GIOP_Message_Base::process_locate_request (TAO_Transport *transport, } else { - status_info.forward_location_var = server_request.forward_location (); - // Normal exception, so the object is not here status_info.status = GIOP::UNKNOWN_OBJECT; ACE_DEBUG ((LM_DEBUG, diff --git a/TAO/tao/PI_Server/ServerInterceptorAdapter.cpp b/TAO/tao/PI_Server/ServerInterceptorAdapter.cpp index 7bb14cadca2..3a3da8b5430 100644 --- a/TAO/tao/PI_Server/ServerInterceptorAdapter.cpp +++ b/TAO/tao/PI_Server/ServerInterceptorAdapter.cpp @@ -82,6 +82,7 @@ TAO::ServerRequestInterceptor_Adapter_Impl::tao_ft_interception_point ( { server_request.forward_location (exc.forward.in ()); server_request.pi_reply_status (PortableInterceptor::LOCATION_FORWARD); + server_request.reply_status (GIOP::LOCATION_FORWARD); (void) this->send_other (server_request, args, nargs, @@ -149,6 +150,7 @@ TAO::ServerRequestInterceptor_Adapter_Impl::receive_request_service_contexts ( { server_request.forward_location (exc.forward.in ()); server_request.pi_reply_status (PortableInterceptor::LOCATION_FORWARD); + server_request.reply_status (GIOP::LOCATION_FORWARD); (void) this->send_other (server_request, args, nargs, @@ -213,6 +215,7 @@ TAO::ServerRequestInterceptor_Adapter_Impl::receive_request_service_contexts ( { server_request.forward_location (exc.forward.in ()); server_request.pi_reply_status (PortableInterceptor::LOCATION_FORWARD); + server_request.reply_status (GIOP::LOCATION_FORWARD); (void) this->send_other (server_request, args, nargs, @@ -281,6 +284,7 @@ TAO::ServerRequestInterceptor_Adapter_Impl::receive_request ( { server_request.forward_location (exc.forward.in ()); server_request.pi_reply_status (PortableInterceptor::LOCATION_FORWARD); + server_request.reply_status (GIOP::LOCATION_FORWARD); this->send_other (server_request, args, nargs, @@ -392,6 +396,7 @@ TAO::ServerRequestInterceptor_Adapter_Impl::send_exception ( { server_request.forward_location (exc.forward.in ()); server_request.pi_reply_status (PortableInterceptor::LOCATION_FORWARD); + server_request.reply_status (GIOP::LOCATION_FORWARD); this->send_other (server_request, args, nargs, @@ -483,6 +488,7 @@ TAO::ServerRequestInterceptor_Adapter_Impl::send_other ( { server_request.forward_location (exc.forward.in ()); server_request.pi_reply_status (PortableInterceptor::LOCATION_FORWARD); + server_request.reply_status (GIOP::LOCATION_FORWARD); this->send_other (server_request, args, nargs, diff --git a/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp b/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp index 2c16f0dad5f..7fd09191dd4 100644 --- a/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp +++ b/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp @@ -21,6 +21,7 @@ void TAO::Direct_Collocation_Upcall_Wrapper::upcall ( CORBA::Object_ptr obj, CORBA::Object_out forward_obj, + bool & is_forwarded, TAO::Argument ** args, int num_args, const char * op, @@ -47,6 +48,7 @@ TAO::Direct_Collocation_Upcall_Wrapper::upcall ( { forward_obj = CORBA::Object::_duplicate (forward_request.forward_reference.in ()); + is_forwarded = true; } #else ACE_UNUSED_ARG (forward_obj); diff --git a/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h b/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h index ca178c39e5a..339a0054114 100644 --- a/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h +++ b/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h @@ -56,6 +56,7 @@ namespace TAO void upcall ( CORBA::Object_ptr obj, CORBA::Object_out forward_obj, + bool & is_forwarded, TAO::Argument ** args, int num_args, const char * op, diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index 0a5d7857479..91c3d86e308 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -791,6 +791,7 @@ TAO_Object_Adapter::dispatch (TAO::ObjectKey &key, if (result == TAO_Adapter::DS_FORWARD) { request.reply_status (GIOP::LOCATION_FORWARD); + request.pi_reply_status (PortableInterceptor::LOCATION_FORWARD); request.forward_location (forward_to.ptr ()); if (sri_adapter != 0) { diff --git a/TAO/tao/PortableServer/PolicyS.cpp b/TAO/tao/PortableServer/PolicyS.cpp index 1cecf8b3974..44cab468d4b 100644 --- a/TAO/tao/PortableServer/PolicyS.cpp +++ b/TAO/tao/PortableServer/PolicyS.cpp @@ -273,6 +273,7 @@ void POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::dispatch ( CORBA::Object_ptr obj, CORBA::Object_out forward_obj, + bool & is_forwarded, TAO::Argument ** args, int num_args, const char * op, @@ -285,6 +286,7 @@ POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::dispatch ( collocation_upcall_wrapper.upcall ( obj, forward_obj, + is_forwarded, args, num_args, op, diff --git a/TAO/tao/PortableServer/PolicyS.h b/TAO/tao/PortableServer/PolicyS.h index 5158592f1c4..62ddf1604d0 100644 --- a/TAO/tao/PortableServer/PolicyS.h +++ b/TAO/tao/PortableServer/PolicyS.h @@ -211,6 +211,7 @@ namespace POA_CORBA dispatch ( CORBA::Object_ptr obj, CORBA::Object_out forward_obj, + bool & is_forwarded, TAO::Argument ** args, int num_args, const char * op, diff --git a/TAO/tao/PortableServer/Upcall_Wrapper.cpp b/TAO/tao/PortableServer/Upcall_Wrapper.cpp index 7da86e41a1e..fe00d465c16 100644 --- a/TAO/tao/PortableServer/Upcall_Wrapper.cpp +++ b/TAO/tao/PortableServer/Upcall_Wrapper.cpp @@ -200,8 +200,7 @@ TAO::Upcall_Wrapper::upcall (TAO_ServerRequest & server_request, #if TAO_HAS_INTERCEPTORS == 1 // Don't bother marshaling inout/out/return values if an interceptor // caused a location forward. - CORBA::Object_var forward_to_end = server_request.forward_location (); - if (CORBA::is_nil (forward_to_end.in ())) + if (!server_request.is_forwarded ()) #endif /* TAO_HAS_INTERCEPTORS == 1 */ { if (server_request.outgoing ()) diff --git a/TAO/tests/Oneway_Send_Timeouts/Client.cpp b/TAO/tests/Oneway_Send_Timeouts/Client.cpp index 11dffcd5284..5ec312f05ba 100644 --- a/TAO/tests/Oneway_Send_Timeouts/Client.cpp +++ b/TAO/tests/Oneway_Send_Timeouts/Client.cpp @@ -21,6 +21,12 @@ Client::Client (int argc, ACE_TCHAR* argv[]) Client::~Client () { + if (!CORBA::is_nil (orb_.in())) { + orb_->shutdown (1); + orb_->destroy (); + orb_ = CORBA::ORB::_nil(); + } + ACE_DEBUG ((LM_DEBUG, "(%P|%t) ~Client>\n")); } @@ -29,6 +35,10 @@ Client::init (int argc, ACE_TCHAR* argv[]) { try { orb_ = CORBA::ORB_init (argc, argv, "Client"); + if (CORBA::is_nil (orb_.in())) { + ACE_ERROR ((LM_ERROR, "Client::init> ORB initialization failed.\n")); + return false; + } if (!this->parse_args (argc, argv)) { return false; @@ -188,6 +198,11 @@ Client::run () { bool status = true; + if (CORBA::is_nil (orb_.in())) { + ACE_ERROR ((LM_ERROR, "Client::run> nil ORB found.\n")); + return false; + } + try { try { if (one_way_test_) @@ -214,10 +229,6 @@ Client::run () , ex._info().c_str())); status = false; } - - orb_->shutdown (1); - orb_->destroy (); - orb_ = CORBA::ORB::_nil(); } catch( CORBA::Exception& ex) { ACE_ERROR ((LM_ERROR, "(%P|%t) Client::run> Caught during test shutdown CORBA::Exception %s" diff --git a/TAO/tests/Oneway_Send_Timeouts/Server.cpp b/TAO/tests/Oneway_Send_Timeouts/Server.cpp index b3d61200662..72aafa977f3 100644 --- a/TAO/tests/Oneway_Send_Timeouts/Server.cpp +++ b/TAO/tests/Oneway_Send_Timeouts/Server.cpp @@ -16,7 +16,6 @@ void replace (ACE_TCHAR** a, ACE_TCHAR** b) Server::Server (int , ACE_TCHAR* argv[]) : init_ (false), shutdown_ (false) - , orb_shutdown_ (false), management_orb_shutdown_ (false) { try { ACE_ARGV args_1 (argv); @@ -46,6 +45,10 @@ Server::Server (int , ACE_TCHAR* argv[]) my_argc--; my_argc--; orb_ = CORBA::ORB_init (my_argc, my_argv, "Server"); + if (CORBA::is_nil (orb_.in())) { + ACE_ERROR ((LM_ERROR, "Server::Server> ORB initialization failed.\n")); + return; + } my_argv = args_2.argv(); my_argc = args_2.argc(); @@ -64,6 +67,10 @@ Server::Server (int , ACE_TCHAR* argv[]) // initialize management ORB my_argc--; my_argc--; management_orb_ = CORBA::ORB_init (my_argc, my_argv, "Management"); + if (CORBA::is_nil (orb_.in())) { + ACE_ERROR ((LM_ERROR, "Server::Server> Mgmt ORB initialization failed.\n")); + return; + } if (!this->parse_args (my_argc, my_argv)) return; @@ -145,9 +152,8 @@ Server::run (bool management) bool status = true; try { - if (!management) { + if (!management && !CORBA::is_nil (orb_.in())) { orb_->run (); - orb_shutdown_ = true; } } catch( CORBA::Exception& ex) { @@ -157,9 +163,8 @@ Server::run (bool management) } try { - if (management) { + if (management && !CORBA::is_nil (management_orb_.in())) { management_orb_->run(); - management_orb_shutdown_ = true; } } catch( CORBA::Exception& ex) { @@ -180,20 +185,19 @@ Server::shutdown () } try { + if (!CORBA::is_nil (management_orb_.in())) { management_orb_->shutdown (1); - - ACE_Time_Value sleep_time; - sleep_time.msec (10); - while (true) { - ACE_OS::sleep (sleep_time); - if (management_orb_shutdown_ && orb_shutdown_) { - break; - } + ACE_OS::sleep (1); // Let management thread clear out } + ACE_auto_ptr_reset (test_i_, (Test_i*)0); + if (!CORBA::is_nil (orb_.in())) { orb_->destroy (); + } orb_ = CORBA::ORB::_nil(); + if (!CORBA::is_nil (management_orb_.in())) { management_orb_->destroy (); + } management_orb_ = CORBA::ORB::_nil(); } catch( CORBA::Exception& ex) { diff --git a/TAO/tests/Oneway_Send_Timeouts/Server_Task.h b/TAO/tests/Oneway_Send_Timeouts/Server_Task.h index 5072936eef8..ed5db5eb1bd 100644 --- a/TAO/tests/Oneway_Send_Timeouts/Server_Task.h +++ b/TAO/tests/Oneway_Send_Timeouts/Server_Task.h @@ -38,13 +38,12 @@ class Server_Task : public ACE_Task_Base if (initializer) { server_->run (false); + this->force_shutdown (); // servant thread is responsible for shutdown } else { server_->run (true); } - this->force_shutdown (); - return 0; } diff --git a/TAO/tests/Oneway_Send_Timeouts/Test_i.cpp b/TAO/tests/Oneway_Send_Timeouts/Test_i.cpp index 28ae1e4385b..5acc58c085d 100644 --- a/TAO/tests/Oneway_Send_Timeouts/Test_i.cpp +++ b/TAO/tests/Oneway_Send_Timeouts/Test_i.cpp @@ -6,12 +6,15 @@ #include "ace/OS_NS_unistd.h" Test_i::Test_i (CORBA::ORB_ptr orb) - : sleep_ (false), unsleep_ (true) + : sleep_ (false), unsleep_ (true), shutdown_ (false) , orb_ (CORBA::ORB::_duplicate (orb)) { } Test_i::~Test_i () { + if (!shutdown_) { + this->shutdown (); + } ACE_DEBUG ((LM_DEBUG, "(%P|%t) ~Test_i>\n")); } @@ -79,5 +82,6 @@ void Test_i::shutdown () { orb_->shutdown (0); + shutdown_ = true; ACE_DEBUG ((LM_DEBUG, "(%P|%t) Test_i::shutdown>\n")); } diff --git a/TAO/tests/Oneway_Send_Timeouts/Test_i.h b/TAO/tests/Oneway_Send_Timeouts/Test_i.h index a70c3ae45b6..75c56a3acc7 100644 --- a/TAO/tests/Oneway_Send_Timeouts/Test_i.h +++ b/TAO/tests/Oneway_Send_Timeouts/Test_i.h @@ -24,6 +24,7 @@ class Test_i : public virtual POA_Test private: volatile bool sleep_; volatile bool unsleep_; + volatile bool shutdown_; CORBA::ORB_var orb_; }; diff --git a/TAO/tests/Oneway_Send_Timeouts/main.cpp b/TAO/tests/Oneway_Send_Timeouts/main.cpp index 4a4232cdc87..a7cf7d3a138 100644 --- a/TAO/tests/Oneway_Send_Timeouts/main.cpp +++ b/TAO/tests/Oneway_Send_Timeouts/main.cpp @@ -63,6 +63,7 @@ MyMain::init_server (const ACE_TCHAR* args) if (!server_task_->ready()) { server_task_->force_shutdown (); + server_task_->wait (); ACE_auto_ptr_reset (server_task_, (Server_Task*)0); return false; } |