diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2018-12-06 15:04:20 +0100 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2018-12-06 15:04:20 +0100 |
commit | b0132099959c23e3ca2c3160dcaf18184584d0c8 (patch) | |
tree | 4d3bcbff8a50bc72c5aa3fb83f00f7abfe8d596b /TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp | |
parent | 0c248242a20b6b480a9514d1ea16ff05c1034890 (diff) | |
download | ATCD-b0132099959c23e3ca2c3160dcaf18184584d0c8.tar.gz |
Remove default argument of 0 to remove_server, when we know the process id, we pass it, this way when the server itself invokes server_is_shutting_down we need to retrieve the current process id and use it
* TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp:
* TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp:
* TAO/orbsvcs/ImplRepo_Service/LiveCheck.h:
* TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp:
* TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp:
Diffstat (limited to 'TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp')
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp index bd15d396565..218451db95f 100644 --- a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp @@ -885,7 +885,7 @@ LiveCheck::remove_server (const char *server, int pid) if (ImR_Locator_i::debug () > 0) { ORBSVCS_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) LiveCheck::remove_server <%C> pid <%d> entry pid <%d>") + ACE_TEXT ("(%P|%t) LiveCheck::remove_server <%C> pid <%d> entry pid <%d> ") ACE_TEXT ("called during handle_timeout\n"), server, pid, entry->pid ())); } if (!this->in_handle_timeout ()) @@ -897,16 +897,13 @@ LiveCheck::remove_server (const char *server, int pid) } else { - // pid can be zero when the server does inform us that it is shutting down, because - // of that we need to store the entry pid for removal later, not that we remove - // the wrong entry later on if (ImR_Locator_i::debug () > 0) { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) LiveCheck::remove_server <%C> pid <%d> entry pid <%d> ") ACE_TEXT ("called during handle_timeout\n"), server, pid, entry->pid ())); } - this->removed_entries_.insert_tail (std::make_pair (s, entry->pid ())); + this->removed_entries_.insert_tail (std::make_pair (s, pid)); } } else @@ -926,28 +923,42 @@ LiveCheck::remove_deferred_servers (void) { if (!this->removed_entries_.is_empty ()) { - NamePidStack::iterator re_end = this->removed_entries_.end(); - for (NamePidStack::iterator re = this->removed_entries_.begin(); - re != re_end; - ++re) + // When we are in handle_timeout we can't remove deferred servers + if (!this->in_handle_timeout ()) + { + NamePidStack::iterator re_end = this->removed_entries_.end(); + for (NamePidStack::iterator re = this->removed_entries_.begin(); + re != re_end; + ++re) + { + NamePidPair const & name_pid_pair = (*re); + if (ImR_Locator_i::debug () > 0) + { + ORBSVCS_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) LiveCheck::remove_deferred_servers ") + ACE_TEXT ("removing <%C> pid <%d>\n"), + name_pid_pair.first.c_str(), name_pid_pair.second)); + } + // Now try to remove the server, remove_server + // will make sure that we only remove the server when the + // name and pid match. These could potentially not + // match when the server has already been restarted between the + // moment it got in the removed_entries_ stack and this point + // where we remove it from the internal administration + this->remove_server (name_pid_pair.first.c_str(), name_pid_pair.second); + } + this->removed_entries_.reset (); + } + else { - NamePidPair const & name_pid_pair = (*re); if (ImR_Locator_i::debug () > 0) { ORBSVCS_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) LiveCheck::remove_deferred_entries ") - ACE_TEXT ("removing <%C> pid <%d>\n"), - name_pid_pair.first.c_str(), name_pid_pair.second)); + ACE_TEXT ("(%P|%t) LiveCheck::remove_deferred_servers ") + ACE_TEXT ("Can't remove <%d> servers because we are still in handle timeout\n"), + this->removed_entries_.size ())); } - // Now try to remove the server, remove_server - // will make sure that we only remove the server when the - // name and pid match. These could potentially not - // match when the server has already been restarted between the - // moment it got in the removed_entries_ stack and this point - // where we remove it from the internal administration - this->remove_server (name_pid_pair.first.c_str(), name_pid_pair.second); } - this->removed_entries_.reset (); } } |