diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2019-05-02 08:53:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-02 08:53:04 +0200 |
commit | 1d4d6c2b23ec0bddcaeb5171933e36a52d5c2237 (patch) | |
tree | 134574a147276ce59c020aee1d3476ebb8f2b66e | |
parent | 868a418a8713ea7382966650530ad6c931250730 (diff) | |
parent | 3bd772780b1a4bbc2dde75a97cce17370ad42fe6 (diff) | |
download | ATCD-1d4d6c2b23ec0bddcaeb5171933e36a52d5c2237.tar.gz |
Merge pull request #901 from jwillemsen/jwi-implrepopingfailed
ImplRepo fix for when a ping failed and we should get a death notify
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp | 32 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp | 17 |
2 files changed, 37 insertions, 12 deletions
diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp index a5078b1f7c2..513f5d2e2de 100644 --- a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp @@ -650,8 +650,8 @@ AsyncAccessManager::ping_replied (LiveStatus server) if (ImR_Locator_i::debug () > 4) { ORBSVCS_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) AsyncAccessManager(%@)::ping_replied pid = %d,") - ACE_TEXT (" transition to <WAIT_FOR_DEATH>\n"), + ACE_TEXT ("(%P|%t) AsyncAccessManager(%@)::ping_replied pid <%d>,") + ACE_TEXT (" waiting on ping, transition to <WAIT_FOR_DEATH>\n"), this, this->info_->pid)); } this->status (ImplementationRepository::AAM_WAIT_FOR_DEATH); @@ -660,7 +660,7 @@ AsyncAccessManager::ping_replied (LiveStatus server) if (ImR_Locator_i::debug () > 4) { ORBSVCS_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) AsyncAccessManager(%@)::ping_replied pid = %d,") + ACE_TEXT ("(%P|%t) AsyncAccessManager(%@)::ping_replied pid <%d>,") ACE_TEXT (" trying to restart server\n"), this, this->info_->pid)); } @@ -671,7 +671,31 @@ AsyncAccessManager::ping_replied (LiveStatus server) } else { - this->status (ImplementationRepository::AAM_SERVER_DEAD); + // If we get a death notify we wait for the death of the process, the fact that the + // ping failed doesn't mean the process itself is already death + if (this->info_->death_notify && this->info_->pid != 0) + { + if (ImR_Locator_i::debug () > 4) + { + ORBSVCS_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) AsyncAccessManager(%@)::ping_replied pid <%d>,") + ACE_TEXT (" transition to <WAIT_FOR_DEATH>\n"), + this, this->info_->pid)); + } + this->status (ImplementationRepository::AAM_WAIT_FOR_DEATH); + return; + } + else + { + if (ImR_Locator_i::debug () > 4) + { + ORBSVCS_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) AsyncAccessManager(%@)::ping_replied pid <%d>,") + ACE_TEXT (" transition to <SERVER_DEAD>\n"), + this, this->info_->pid)); + } + this->status (ImplementationRepository::AAM_SERVER_DEAD); + } } } break; diff --git a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp index 0751d522a6f..b0136bee5bd 100644 --- a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp @@ -346,18 +346,19 @@ LiveEntry::has_pid (int pid) const bool LiveEntry::validate_ping (bool &want_reping, ACE_Time_Value& next) { + if (ImR_Locator_i::debug () > 4) + { + ORBSVCS_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) LiveEntry::validate_ping, status ") + ACE_TEXT ("<%C> listeners <%d> server <%C> pid <%d>\n"), + status_name (this->liveliness_), this->listeners_.size (), + this->server_.c_str(), this->pid_)); + } + if (this->liveliness_ == LS_PING_AWAY || this->liveliness_ == LS_DEAD || this->listeners_.is_empty ()) { - if (ImR_Locator_i::debug () > 4) - { - ORBSVCS_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) LiveEntry::validate_ping, status ") - ACE_TEXT ("<%C> listeners <%d> server <%C> pid <%d>\n"), - status_name (this->liveliness_), this->listeners_.size (), - this->server_.c_str(), this->pid_)); - } return false; } ACE_Time_Value const now (ACE_OS::gettimeofday()); |