diff options
author | Phil Mesnier <mesnier_p@ociweb.com> | 2006-05-15 14:27:02 +0000 |
---|---|---|
committer | Phil Mesnier <mesnier_p@ociweb.com> | 2006-05-15 14:27:02 +0000 |
commit | 5b0b92a45c3285b74149e09cd27761f9554d1d83 (patch) | |
tree | a79a0d4670887c0e1e42925acb0bfb367d147c97 | |
parent | 2ba3464b5529f9a687224cfc7e40802a4d6a2ce5 (diff) | |
download | ATCD-5b0b92a45c3285b74149e09cd27761f9554d1d83.tar.gz |
ChangeLog tag: Mon May 15 13:28:01 UTC 2006 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r-- | TAO/ChangeLog | 22 | ||||
-rw-r--r-- | TAO/tests/AMI_Buffering/AMI_Buffering.cpp | 50 | ||||
-rw-r--r-- | TAO/tests/AMI_Buffering/AMI_Buffering.h | 22 | ||||
-rw-r--r-- | TAO/tests/AMI_Buffering/client.cpp | 4 |
4 files changed, 90 insertions, 8 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index f09d05a83a7..c90f23b67b9 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,25 @@ +Mon May 15 13:28:01 UTC 2006 Phil Mesnier <mesnier_p@ociweb.com> + + * tests/AMI_Buffering/AMI_Buffering.h: + * tests/AMI_Buffering/AMI_Buffering.cpp: + * tests/AMI_Buffering/client.cpp: + + The tests still fail on a lot of machines with a series of + COMM_FAIL exceptions being reported. These are due to a nesting + problem within the server, since it is receiving requests from + the client and also making requests to the admin. What happens + is that with the asynchronous calls, a whole bunch of requests + are sent to the server, and before it gets a chance to receive + all the replies from the admin, the client sends a shutdown. + This immediately closes the server's client-side connection to + the admin, and if any replies were pending, those are lost, + causing the comm fails. I've also added a log message reporting + the maximum nesting level attained by the server. + + The client now delegates responsibility of shutting down the + admin to the server as another way of eliminating any races that + might cause spurious error reports. + Mon May 15 12:58:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl> * tao/Unbounded_Octet_Sequence_T.h: diff --git a/TAO/tests/AMI_Buffering/AMI_Buffering.cpp b/TAO/tests/AMI_Buffering/AMI_Buffering.cpp index 33fcd602110..aaaaf5b0cd2 100644 --- a/TAO/tests/AMI_Buffering/AMI_Buffering.cpp +++ b/TAO/tests/AMI_Buffering/AMI_Buffering.cpp @@ -7,18 +7,45 @@ ACE_RCSID(AMI_Buffering, AMI_Buffering, "$Id$") AMI_Buffering::AMI_Buffering (CORBA::ORB_ptr orb, Test::AMI_Buffering_Admin_ptr admin) - : orb_ (CORBA::ORB::_duplicate (orb)) - , admin_ (Test::AMI_Buffering_Admin::_duplicate (admin)) + : orb_ (CORBA::ORB::_duplicate (orb)), + admin_ (Test::AMI_Buffering_Admin::_duplicate (admin)), + nest_ (0), + max_nest_ (0), + must_shutdown_ (false) { } +AMI_Buffering::Nest_Guard::Nest_Guard (AMI_Buffering &a) + :target_(a) +{ + ++target_.nest_; + if (target_.nest_ > target_.max_nest_) + target_.max_nest_ = target_.nest_; +} + +AMI_Buffering::Nest_Guard::~Nest_Guard (void) +{ + --target_.nest_; +} + void AMI_Buffering::receive_data (const Test::Payload &the_payload ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->admin_->request_received (the_payload.length () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ACE_TRY + { + AMI_Buffering::Nest_Guard ng(*this); + this->admin_->request_received (the_payload.length () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_DEBUG ((LM_DEBUG,"(%P|%t) DEBUG: AMI_Buffering::receive_data")); + } + ACE_ENDTRY; + + this->try_shutdown(ACE_ENV_SINGLE_ARG_PARAMETER); } void @@ -39,6 +66,21 @@ void AMI_Buffering::shutdown (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + this->must_shutdown_ = true; + this->try_shutdown(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; +} + +void +AMI_Buffering::try_shutdown(ACE_ENV_SINGLE_ARG_DECL) +{ + if (!this->must_shutdown_ || this->nest_ > 0) + return; + if (this->max_nest_ > 1) + ACE_DEBUG ((LM_DEBUG, "(%P|%t) max nesting level: %d\n", max_nest_)); + this->admin_->shutdown(ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); ACE_CHECK; } diff --git a/TAO/tests/AMI_Buffering/AMI_Buffering.h b/TAO/tests/AMI_Buffering/AMI_Buffering.h index c5030340c1d..f554d01d66b 100644 --- a/TAO/tests/AMI_Buffering/AMI_Buffering.h +++ b/TAO/tests/AMI_Buffering/AMI_Buffering.h @@ -32,11 +32,33 @@ public: ACE_THROW_SPEC ((CORBA::SystemException)); private: + /// internal implementation of shutdown. This + void try_shutdown (ACE_ENV_SINGLE_ARG_DECL); + + class Nest_Guard + { + public: + Nest_Guard (AMI_Buffering &); + ~Nest_Guard (void); + private: + AMI_Buffering &target_; + }; + /// Use an ORB reference to shutdown the application. CORBA::ORB_var orb_; /// Report request progress to this interface Test::AMI_Buffering_Admin_var admin_; + + /// nesting depth count for receive_data processing + int nest_; + + /// maximum nesting depth reached during run + int max_nest_; + + /// flag indicating that a shutdown is required as soon + /// as the nest count reaches 0. + bool must_shutdown_; }; #include /**/ "ace/post.h" diff --git a/TAO/tests/AMI_Buffering/client.cpp b/TAO/tests/AMI_Buffering/client.cpp index 28514a1f7c8..eb5819492ca 100644 --- a/TAO/tests/AMI_Buffering/client.cpp +++ b/TAO/tests/AMI_Buffering/client.cpp @@ -7,7 +7,6 @@ #include "tao/AnyTypeCode/TAOA.h" #include "tao/AnyTypeCode/Any.h" #include "ace/Get_Opt.h" -#include "ace/OS_NS_unistd.h" ACE_RCSID(AMI_Buffering, client, "$Id$") @@ -241,9 +240,6 @@ main (int argc, char *argv[]) ami_buffering->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - ACE_OS::sleep(1); - ami_buffering_admin->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; |