From 95fa3ab2bd0bf931686ab0d9095d67cd63c62315 Mon Sep 17 00:00:00 2001 From: coryan Date: Tue, 1 Jun 1999 23:25:38 +0000 Subject: ChangeLogTag:Tue Jun 1 18:13:07 1999 Carlos O'Ryan --- TAO/ChangeLog-99c | 27 +++++++++++++++++++++++++++ TAO/tao/Connect.cpp | 4 ++-- TAO/tao/GIOP.cpp | 7 ++++--- TAO/tao/IIOP_Transport.cpp | 2 +- TAO/tao/Invocation.cpp | 5 +---- TAO/tao/Wait_Strategy.cpp | 21 +++++++++++---------- TAO/tests/NestedUpcall/Reactor/README | 22 +++++++++++++++------- TAO/tests/NestedUpcall/Reactor/mt_client.cpp | 22 +++++++++++++++++++++- TAO/tests/NestedUpcall/Reactor/run_test.pl | 10 ++++++++++ TAO/tests/NestedUpcall/Reactor/svc.mt.conf | 6 ++++++ 10 files changed, 98 insertions(+), 28 deletions(-) create mode 100644 TAO/tests/NestedUpcall/Reactor/svc.mt.conf diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c index 684825cc439..8602e798812 100644 --- a/TAO/ChangeLog-99c +++ b/TAO/ChangeLog-99c @@ -1,3 +1,30 @@ +Tue Jun 1 18:13:07 1999 Carlos O'Ryan + + * tao/GIOP.cpp: + * tao/Connect.cpp: + Improved debug messages for connection closing. + + * tao/IIOP_Transport.cpp: + * tao/Wait_Strategy.cpp: + Commented out fine-grained debug messages + + * tao/Invocation.cpp: + The wait_for_reply() call was in a while() loop. Under some + circumstances the while loop would not be entered, this race + condition was causing all kinds of evil crashes and failures. + The loop was not really needed because the wait_for_reply() call + can handle the case where the data has already arrived. + + * tests/NestedUpcall/Reactor/mt_client.cpp: + Fixed ORB and POA initialization + + * tests/NestedUpcall/Reactor/run_test.pl: + * tests/NestedUpcall/Reactor/README: + * tests/NestedUpcall/Reactor/svc.mt.conf: + Added a new configuration file for the mt_client test. + Documented the new mt_client test in the README file, added the + test to the run_test.pl file + Tue Jun 1 13:14:00 1999 Carlos O'Ryan * tao/Wait_Strategy.cpp: diff --git a/TAO/tao/Connect.cpp b/TAO/tao/Connect.cpp index 0646f05b37b..2a069ec0963 100644 --- a/TAO/tao/Connect.cpp +++ b/TAO/tao/Connect.cpp @@ -776,7 +776,7 @@ TAO_Server_Connection_Handler::handle_input (ACE_HANDLE) { // No exception but some kind of error, yet a response is // required. - if (TAO_orbdebug) + if (TAO_debug_level > 0) ACE_ERROR ((LM_ERROR, "TAO: (%P|%t) %s: closing conn, no exception, " "but expecting response\n", @@ -789,7 +789,7 @@ TAO_Server_Connection_Handler::handle_input (ACE_HANDLE) { // No exception, no response expected, but an error ocurred, // close the socket. - if (TAO_orbdebug) + if (TAO_debug_level > 0) ACE_ERROR ((LM_ERROR, "TAO: (%P|%t) %s: closing conn, no exception, " "but expecting response\n", diff --git a/TAO/tao/GIOP.cpp b/TAO/tao/GIOP.cpp index 76cd8b7f6ed..024602f5d90 100644 --- a/TAO/tao/GIOP.cpp +++ b/TAO/tao/GIOP.cpp @@ -520,7 +520,8 @@ TAO_GIOP::recv_message (TAO_Transport *transport, case 0: if (TAO_orbdebug) ACE_DEBUG ((LM_DEBUG, - "(%t) End of connection, transport handle %d\n", + "TAO (%P|%t) GIOP::recv_message " + "end of connection, transport handle %d\n", transport->handle ())); return TAO_GIOP::EndOfFile; // @@ should probably find some way to report this without @@ -531,7 +532,7 @@ TAO_GIOP::recv_message (TAO_Transport *transport, case -1: // error if (TAO_orbdebug) ACE_DEBUG ((LM_ERROR, - "(%P|%t) GIOP::recv_message header %p\n", + "TAO (%P|%t) GIOP::recv_message header %p\n", "read_buffer")); break; /* NOTREACHED */ @@ -539,7 +540,7 @@ TAO_GIOP::recv_message (TAO_Transport *transport, default: if (TAO_orbdebug) ACE_DEBUG ((LM_ERROR, - "(%P|%t) GIOP::recv_message header read failed, " + "TAO (%P|%t) GIOP::recv_message header read failed, " "only %d of %d bytes\n", len, header_len)); diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp index 9e5ac394bfb..3d696246ba6 100644 --- a/TAO/tao/IIOP_Transport.cpp +++ b/TAO/tao/IIOP_Transport.cpp @@ -327,7 +327,7 @@ TAO_IIOP_Client_Transport::handle_client_input (int block) // (i.e. the stack was unrolled on the thread waiting for this // event), since this is only needed for *true* asynchronous // messaging. - ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - dispatching reply <%x>\n", this)); + //ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - dispatching reply <%x>\n", this)); if (this->rms_->dispatch_reply (request_id, reply_status, version, diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index e620fa54d37..7dc308adc81 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -772,10 +772,7 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV) // Wait for the reply. We should wait till we receive the reply // fully. // @@ Check for return value -1 here !!! (Alex). - int reply_error = 0; - - while (!this->transport_->message_received () && reply_error == 0) - reply_error = this->transport_->wait_for_reply (); + int reply_error = this->transport_->wait_for_reply (); if (reply_error == -1) { diff --git a/TAO/tao/Wait_Strategy.cpp b/TAO/tao/Wait_Strategy.cpp index 6a85ab08c78..0281e7ffff1 100644 --- a/TAO/tao/Wait_Strategy.cpp +++ b/TAO/tao/Wait_Strategy.cpp @@ -189,9 +189,10 @@ TAO_Wait_On_Leader_Follower::send_request (TAO_ORB_Core *orb_core, this->expecting_response_ = 0; this->calling_thread_ = ACE_OS::NULL_thread; - ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - failed request for <%x>\n", - this->transport_)); + //ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - failed request for <%x>\n", + //this->transport_)); } + return result; } int @@ -234,8 +235,8 @@ TAO_Wait_On_Leader_Follower::wait (void) { // = Wait as a follower. - ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - wait (follower) on <%x>\n", - this->transport_)); + //ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - wait (follower) on <%x>\n", + //this->transport_)); // wait until we have input available or there is no leader, in // which case we must become the leader anyway.... @@ -265,8 +266,8 @@ TAO_Wait_On_Leader_Follower::wait (void) "TAO (%P|%t) TAO_Wait_On_Leader_Follower::wait - " "remove_follower failed for <%x>\n", cond)); - ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - done (follower:%d) on <%x>\n", - this->reply_received_, this->transport_)); + //ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - done (follower:%d) on <%x>\n", + //this->reply_received_, this->transport_)); // Now somebody woke us up to become a leader or to handle // our input. We are already removed from the follower queue. @@ -318,14 +319,14 @@ TAO_Wait_On_Leader_Follower::wait (void) int result = 0; - ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - wait (leader) on <%x>\n", - this->transport_)); + //ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - wait (leader) on <%x>\n", + //this->transport_)); while (result >= 0 && this->reply_received_ == 0) result = orb_core->reactor ()->handle_events (); - ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - done (leader) on <%x>\n", - this->transport_)); + //ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - done (leader) on <%x>\n", + //this->transport_)); // Re-acquire the lock. if (ace_mon.acquire () == -1) diff --git a/TAO/tests/NestedUpcall/Reactor/README b/TAO/tests/NestedUpcall/Reactor/README index a1147be10e4..ad55350a1a3 100644 --- a/TAO/tests/NestedUpcall/Reactor/README +++ b/TAO/tests/NestedUpcall/Reactor/README @@ -36,13 +36,10 @@ client if you don't want to use the naming service. server: ------- -% server [-d] [-s] [-ORBhost ] [-ORBport ] - [-o ] +% server [-d] [-o ] Options: ------- --s Tells the server not to use the Naming Service. - -d Debug flag (It is additive more -d flags will give debugging). -o Outputs the ior file to the file @@ -56,14 +53,12 @@ are ignored. client: ------- -% client [-d] [-s] [-x] <-f ior_file> <-k ior> -n +% client [-d] [-x] <-f ior_file> <-k ior> -n Options: ------- d Debug flag - s Don't Use the Naming Service x Tells the server to shutdown. - f Reads the ior from the file k Reads the ior from commandline There are 3 ways of giving the IOR to the client: @@ -76,6 +71,19 @@ Options: 3. Get it from the Naming Service (which is the default client behavior). +mt_client: +------- + +% mt_client [-d] [-x] <-k ior> [-n ] [-t threads] + +Options: +------- + d Debug flag + x Tells the server to shutdown. + k Reads the ior from commandline + n Number of iterations on each thread + t Number of concurrent threads + NestedUpCalls_Test: ------------------ diff --git a/TAO/tests/NestedUpcall/Reactor/mt_client.cpp b/TAO/tests/NestedUpcall/Reactor/mt_client.cpp index c9bbc16ac93..85dd43bc314 100644 --- a/TAO/tests/NestedUpcall/Reactor/mt_client.cpp +++ b/TAO/tests/NestedUpcall/Reactor/mt_client.cpp @@ -97,7 +97,7 @@ NestedUpCalls_MT_Client::svc (void) { ACE_TRY_NEW_ENV { - ACE_DEBUG ((LM_DEBUG, "Running thread (%t)\n")); + ACE_DEBUG ((LM_DEBUG, "Running thread (%t)\n")); // Create an EventHandler servant to hand to the other side... auto_ptr eh_impl (new EventHandler_i); @@ -168,6 +168,26 @@ NestedUpCalls_MT_Client::init (int argc, char *argv[]) ACE_DEBUG ((LM_DEBUG, "Reactor received OK\n")); + + CORBA::Object_var poa_object = + this->orb_->resolve_initial_references("RootPOA", ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (CORBA::is_nil (poa_object.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + 1); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (ACE_TRY_ENV); + ACE_TRY_CHECK; + + poa_manager->activate (ACE_TRY_ENV); + ACE_TRY_CHECK; } ACE_CATCHANY { diff --git a/TAO/tests/NestedUpcall/Reactor/run_test.pl b/TAO/tests/NestedUpcall/Reactor/run_test.pl index 05f15378052..c3ffe2f9b0b 100755 --- a/TAO/tests/NestedUpcall/Reactor/run_test.pl +++ b/TAO/tests/NestedUpcall/Reactor/run_test.pl @@ -20,5 +20,15 @@ $status = system ($EXEPREFIX."client".$Process::EXE_EXT. $SV->Wait (); +$SV = Process::Create ($EXEPREFIX."server".$Process::EXE_EXT, + "-o $file"); + +ACE::waitforfile ($file); + +$status = system ($EXEPREFIX."mt_client".$Process::EXE_EXT. + "-x -k file://$file -ORBsvcconf svc.mt.conf"); + +$SV->Wait (); + # @@ Capture any errors from the server too. exit $status; diff --git a/TAO/tests/NestedUpcall/Reactor/svc.mt.conf b/TAO/tests/NestedUpcall/Reactor/svc.mt.conf new file mode 100644 index 00000000000..ebb9810b5ca --- /dev/null +++ b/TAO/tests/NestedUpcall/Reactor/svc.mt.conf @@ -0,0 +1,6 @@ +# $Id$ +# +# Please see $TAO_ROOT/docs/Options.html for details on these options. +# + +static Client_Strategy_Factory "-ORBclientconnectionhandler MT" -- cgit v1.2.1