diff options
author | Phil Mesnier <mesnier_p@ociweb.com> | 2009-03-19 03:05:36 +0000 |
---|---|---|
committer | Phil Mesnier <mesnier_p@ociweb.com> | 2009-03-19 03:05:36 +0000 |
commit | 04001929657f9bd7621a7ec279b2ed42b741ff58 (patch) | |
tree | 664f092048a40a132ee19f6a4c39fddd43892a4a | |
parent | 94a705db2f6d39f47b2a58ef298e53c582ec054b (diff) | |
download | ATCD-04001929657f9bd7621a7ec279b2ed42b741ff58.tar.gz |
Thu Mar 19 03:02:52 UTC 2009 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r-- | TAO/ChangeLog | 15 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp | 11 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp | 22 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp | 21 |
4 files changed, 58 insertions, 11 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 32e26968389..58bc844545f 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,18 @@ +Thu Mar 19 03:02:52 UTC 2009 Phil Mesnier <mesnier_p@ociweb.com> + + * orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp: + * orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp: + + Improve defense against the same pointer value coincidently + being reused when allocating a filter servant. This occasionally + happens in some of the test drivers, where the same notify + service instance is reused although the specific event channel + is destroyed after each test. Unfortunately the filter_POA is + not, and could hold stale pointers. + + * orbsvcs/orbsvcs/Notify/POA_Helper.cpp: + Cleaned up the debug output a bit. + Wed Mar 18 19:04:22 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl> * tao/Profile.cpp: diff --git a/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp b/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp index 3edde473701..f49d421f8da 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp @@ -115,7 +115,7 @@ TAO_Notify_ETCL_Filter::~TAO_Notify_ETCL_Filter () { try { - this->remove_all_constraints (); + this->destroy(); } catch (const CORBA::Exception&) { @@ -445,11 +445,14 @@ TAO_Notify_ETCL_Filter::destroy (void) ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, CORBA::INTERNAL ()); - this->remove_all_constraints_i (); + if (CORBA::is_nil (this->poa_.in())) + return; - PortableServer::ObjectId_var refTemp = poa_->servant_to_id (this); + this->remove_all_constraints_i (); - poa_->deactivate_object (refTemp.in ()); + PortableServer::ObjectId_var refTemp = this->poa_->servant_to_id (this); + this->poa_->deactivate_object (refTemp.in ()); + this->poa_ = PortableServer::POA::_nil(); } CORBA::Boolean diff --git a/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp b/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp index 52d226543e0..30ce99ba192 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp @@ -117,10 +117,24 @@ TAO_Notify_ETCL_FilterFactory::create_filter ( throw CORBA::INTERNAL (); return 0; } - - PortableServer::ObjectId_var oid = - this->filter_poa_->activate_object (filter); - + + PortableServer::ObjectId_var oid; + try + { + oid = this->filter_poa_->activate_object (filter); + } + catch (PortableServer::POA::ServantAlreadyActive&) + { + try + { + oid = this->filter_poa_->servant_to_id (filter); + } + catch (CORBA::Exception& ) + { + throw CORBA::INTERNAL (); + return 0; + } + } CORBA::Object_var obj = this->filter_poa_->id_to_reference (oid.in ()); diff --git a/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp b/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp index d6926c6f8e4..a52eca64945 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp @@ -160,8 +160,11 @@ TAO_Notify_POA_Helper::activate (PortableServer::Servant servant, CORBA::Long& i if (DEBUG_LEVEL > 0) { CORBA::String_var the_name = this->poa_->the_name (); - - ACE_DEBUG ((LM_DEBUG, "Activating object with id = %d in POA : %s\n", id, the_name.in ())); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) POA_Helper Activating object with ") + ACE_TEXT ("id = %d in POA : %C\n"), + id, the_name.in () + )); } // Convert CORBA::Long to ObjectId @@ -178,7 +181,11 @@ TAO_Notify_POA_Helper::activate_with_id (PortableServer::Servant servant, CORBA: if (DEBUG_LEVEL > 0) { CORBA::String_var the_name = this->poa_->the_name (); - ACE_DEBUG ((LM_DEBUG, "Activating object with existing id = %d in POA : %s\n", id, the_name.in ())); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) POA_Helper Activating object with ") + ACE_TEXT ("existing id = %d in POA : %C\n"), + id, the_name.in () + )); } this->id_factory_.set_last_used (id); @@ -196,6 +203,14 @@ TAO_Notify_POA_Helper::deactivate (CORBA::Long id) const // Convert CORBA::Long to ObjectId PortableServer::ObjectId_var oid = this->long_to_ObjectId (id); + if (DEBUG_LEVEL > 0) + { + CORBA::String_var the_name = this->poa_->the_name (); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) POA_Helper Deactivating object with") + ACE_TEXT ("id = %d in POA : %C\n"), + id, the_name.in ())); + } poa_->deactivate_object (oid.in ()); } |