From 29d99306df66c97856e5a9f1d4c87fe8c8b6dba3 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 15 Apr 2019 13:54:57 +0200 Subject: In server_is_shutting_down we only get informed that the server is going down, we can't assume it is dead at that moment already * TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp: --- .../ImplRepo_Service/AsyncAccessManager.cpp | 27 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp index 456dde6b655..84d684a84b8 100644 --- a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp @@ -465,11 +465,30 @@ AsyncAccessManager::server_is_shutting_down (void) { if (ImR_Locator_i::debug () > 4) { - this->report ("server_is_shutting_down"); + this->report ("server_is_shutting_down-start"); } + // We are informed directly by the server that it is shutting down. This doesn't + // imply that the server is dead at this point, there can be some time between + // the POA destroy and the server process exit so we have to wait for the death + // of the process before we can mark this server as dead this->prev_pid_ = this->info_->pid; - this->status (ImplementationRepository::AAM_SERVER_DEAD); - this->final_state (); + if (this->info_->death_notify) + { + // We get a death notify of the activator so we can wait on the death + // of the process + this->status (ImplementationRepository::AAM_WAIT_FOR_DEATH); + } + else + { + // We don't get a death notify of the activator so we have to assume at + // this point the server is death + this->status (ImplementationRepository::AAM_SERVER_DEAD); + this->final_state (); + } + if (ImR_Locator_i::debug () > 4) + { + this->report ("server_is_shutting_down-end"); + } } void @@ -535,7 +554,7 @@ AsyncAccessManager::notify_child_death (int pid) if (ImR_Locator_i::debug () > 4) { ORBSVCS_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) AsyncAccessManager(%@), child death, server <%C> pid <%d> status <%C> ") + ACE_TEXT ("(%P|%t) AsyncAccessManager(%@), notify_child_death, server <%C> pid <%d> status <%C> ") ACE_TEXT ("this info_.pid <%d> prev_pid <%d> waiter count <%d>\n"), this, info_->ping_id (), pid, status_name (status_), this->info_->pid, this->prev_pid_, this->rh_list_.size())); -- cgit v1.2.1