From a5c873c8bde0d603bca6135f85ea753321248470 Mon Sep 17 00:00:00 2001 From: Phil Mesnier Date: Mon, 13 May 2013 15:02:02 +0000 Subject: Mon May 13 15:00:19 UTC 2013 Phil Mesnier --- TAO/ChangeLog_Asynch_ImR | 12 +++++++++ TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp | 33 +++++++++++++---------- TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h | 1 + TAO/orbsvcs/tests/ImplRepo/servers_list/Test.idl | 2 +- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/TAO/ChangeLog_Asynch_ImR b/TAO/ChangeLog_Asynch_ImR index 0b4baeddc79..36d139a6853 100644 --- a/TAO/ChangeLog_Asynch_ImR +++ b/TAO/ChangeLog_Asynch_ImR @@ -1,3 +1,15 @@ +Mon May 13 15:00:19 UTC 2013 Phil Mesnier + + * orbsvcs/ImplRepo_Service/AsyncListManager.h: + * orbsvcs/ImplRepo_Service/AsyncListManager.cpp: + + Clean up runtime failures. + + * orbsvcs/tests/ImplRepo/servers_list/Test.idl: + + Make the abort() operation a oneway so that commfails are avoided + in the client. + Sun May 12 16:45:48 UTC 2013 Phil Mesnier * orbsvcs/ImplRepo_Service/AsyncAccessManager.h: diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp index 8532e5a1b9d..7a16a42750f 100644 --- a/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp @@ -20,10 +20,10 @@ AsyncListManager::AsyncListManager (const Locator_Repository *repo, pinger_ (pinger), server_list_ (0), first_ (0), + waiters_ (0), refcount_ (1), lock_ () { - } AsyncListManager::~AsyncListManager (void) @@ -39,20 +39,13 @@ AsyncListManager::poa (void) void AsyncListManager::final_state (void) { - CORBA::ULong len = this->server_list_.length (); - if (this->pinger_ != 0) + if (this->pinger_ != 0 && this->waiters_ > 0) { - for (CORBA::ULong i = 0; i < len; i++) - { - if (this->server_list_[i].activeStatus == - ImplementationRepository::ACTIVE_MAYBE) - { - return; - } - } + return; } bool excepted = false; + CORBA::ULong len = this->server_list_.length (); if (!CORBA::is_nil (this->primary_.in())) { @@ -184,20 +177,31 @@ AsyncListManager::list_i (CORBA::ULong start, CORBA::ULong how_many) } } } + if (len == 0 || this->pinger_ == 0) + { + this->final_state (); + } + else + { + this->waiters_ = len; + } } void -AsyncListManager::ping_replied (CORBA::ULong index, LiveStatus server) +AsyncListManager::ping_replied (CORBA::ULong index, LiveStatus status) { - switch (server) + switch (status) { case LS_ALIVE: case LS_LAST_TRANSIENT: - case LS_TIMEDOUT: this->server_list_[index].activeStatus = ImplementationRepository::ACTIVE_YES; break; + case LS_TIMEDOUT: + this->server_list_[index].activeStatus = + ImplementationRepository::ACTIVE_MAYBE; + break; case LS_DEAD: this->server_list_[index].activeStatus = ImplementationRepository::ACTIVE_NO; @@ -205,6 +209,7 @@ AsyncListManager::ping_replied (CORBA::ULong index, LiveStatus server) default: return; } + this->waiters_--; this->final_state(); } diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h index c0916391307..9aa5799b86e 100644 --- a/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h +++ b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h @@ -69,6 +69,7 @@ class AsyncListManager LiveCheck *pinger_; ImplementationRepository::ServerInformationList server_list_; CORBA::ULong first_; + CORBA::ULong waiters_; int refcount_; TAO_SYNCH_MUTEX lock_; }; diff --git a/TAO/orbsvcs/tests/ImplRepo/servers_list/Test.idl b/TAO/orbsvcs/tests/ImplRepo/servers_list/Test.idl index 6624e95ac91..294bfad5aa7 100644 --- a/TAO/orbsvcs/tests/ImplRepo/servers_list/Test.idl +++ b/TAO/orbsvcs/tests/ImplRepo/servers_list/Test.idl @@ -8,7 +8,7 @@ interface Test // After replying, abort process // delay_secs seconds. - void abort ( in short delay_secs ); + oneway void abort ( in short delay_secs ); }; -- cgit v1.2.1