summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Mesnier <mesnier_p@ociweb.com>2014-09-26 00:04:57 +0000
committerPhil Mesnier <mesnier_p@ociweb.com>2014-09-26 00:04:57 +0000
commit03508c878274242e9e878510b12fb815da8ce7ce (patch)
tree35ee3abd341fa100d2b5be2ce82fd0218aef4499
parent1122360fe14f19838cb4bc1a0fe0d1f1fd5a43e0 (diff)
downloadATCD-03508c878274242e9e878510b12fb815da8ce7ce.tar.gz
Fri Sep 26 00:02:11 UTC 2014 Phil Mesnier <mesnier_p@ociweb.com>
* orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp: * orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp: * orbsvcs/ImplRepo_Service/ImR_Locator_i.h: * orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp: * orbsvcs/ImplRepo_Service/Locator_Repository.cpp: * orbsvcs/ImplRepo_Service/Server_Info.h: * orbsvcs/ImplRepo_Service/Server_Info.cpp: Refining the relationship between server infos, the locator and the activator. Use an active ping when allowed to verify the server liveness, then check with the activator to see if it still is the server's parent. Use a new flag to indicate that a child death notification is expected. * orbsvcs/tests/ImplRepo/RestartIMR/run_test.pl: Expand the test to account for new scenarios.
-rw-r--r--TAO/ChangeLog18
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp2
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp1
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp57
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h10
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp13
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp5
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Server_Info.h5
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/RestartIMR/run_test.pl69
9 files changed, 113 insertions, 67 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 6e9bf7c3e60..ef281463c35 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,21 @@
+Fri Sep 26 00:02:11 UTC 2014 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp:
+ * orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp:
+ * orbsvcs/ImplRepo_Service/ImR_Locator_i.h:
+ * orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp:
+ * orbsvcs/ImplRepo_Service/Locator_Repository.cpp:
+ * orbsvcs/ImplRepo_Service/Server_Info.h:
+ * orbsvcs/ImplRepo_Service/Server_Info.cpp:
+ Refining the relationship between server infos, the locator and the
+ activator. Use an active ping when allowed to verify the server
+ liveness, then check with the activator to see if it still is the
+ server's parent. Use a new flag to indicate that a child death
+ notification is expected.
+
+ * orbsvcs/tests/ImplRepo/RestartIMR/run_test.pl:
+ Expand the test to account for new scenarios.
+
Wed Sep 24 19:51:44 CEST 2014 Johnny Willemsen <jwillemsen@remedy.nl>
* TAO version 2.2.8 released.
diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp
index c72f3c95d0a..9b3c9bf34f2 100644
--- a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp
@@ -351,7 +351,7 @@ AsyncAccessManager::ping_replied (LiveStatus server)
{
if (this->status_ == ImplementationRepository::AAM_WAIT_FOR_PING)
{
- if (this->info_->pid != 0)
+ if (this->info_->death_notify && this->info_->pid != 0)
{
if (ImR_Locator_i::debug () > 4)
{
diff --git a/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp b/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp
index 75ec84ffb3b..bb633f2851c 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp
@@ -24,7 +24,6 @@ static const ACE_TCHAR* ALTKEY = ACE_TEXT("AltKey");
static const ACE_TCHAR* POA = ACE_TEXT("POA");
static const ACE_TCHAR* PEERS = ACE_TEXT("Peers");
static const ACE_TCHAR* PID = ACE_TEXT("Pid");
-
#if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_REGISTRY)
static const char* WIN32_REG_KEY = "Software\\TAO\\ImplementationRepository";
#endif
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
index aa4e3b75939..8dd95a2f3b0 100644
--- a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
@@ -182,65 +182,49 @@ ImR_Locator_i::init_with_orb (CORBA::ORB_ptr orb, Options& opts)
for (;it.next (entry) != 0; it.advance ())
{
- Server_Info& info = *(entry->int_id_);
- Server_Info *active = info.active_info ();
- ImplementationRepository::ServerObject_var svrobj = active->server;
- bool is_alive = !CORBA::is_nil (svrobj.in()) &&
- !this->pinger_.has_server (info.ping_id());
+ UpdateableServerInfo info (this->repository_.get(), entry->int_id_);
+ bool is_alive = this->server_is_alive (info);
+ Server_Info *active = info.edit()->active_info ();
if (this->debug_ > 0)
{
ORBSVCS_DEBUG ((LM_DEBUG,
- ACE_TEXT ("step 1: %C alive? %d pid = %d\n"),
- info.ping_id (), is_alive, active->pid));
+ ACE_TEXT ("server %C is_alive = %d\n"),
+ active->ping_id(), is_alive));
}
+
+ if (!is_alive)
+ {
+ info.edit()->reset_runtime ();
+ active->reset_runtime ();
+ continue;
+ }
+
+ active->death_notify = false;
if (active->pid > 0)
{
Activator_Info_Ptr ainfo =
this->get_activator (active->activator);
- if (ainfo.null () ||
- CORBA::is_nil (ainfo->activator.in ()))
- {
- if (this->debug_ > 0)
- {
- ORBSVCS_DEBUG ((LM_DEBUG,
- ACE_TEXT ("step 2: no activator\n")));
- }
- is_alive = false;
- }
- else
+ if (!(ainfo.null () || CORBA::is_nil (ainfo->activator.in ())))
{
ImplementationRepository::ActivatorExt_var actx =
ImplementationRepository::ActivatorExt::_narrow (ainfo->activator.in ());
try
{
- is_alive = !CORBA::is_nil (actx.in ()) &&
- actx->still_alive (active->pid);
+ active->death_notify =
+ !CORBA::is_nil (actx.in ()) && actx->still_alive (active->pid);
}
catch (CORBA::Exception &)
{
- is_alive = false;
}
if (this->debug_ > 0)
{
ORBSVCS_DEBUG ((LM_DEBUG,
- ACE_TEXT ("step 3: activator says alive = %d\n"),
- is_alive));
+ ACE_TEXT ("activator says death_notify = %d\n"),
+ active->death_notify));
}
}
}
-
- if (is_alive)
- {
- this->pinger_.add_server (info.ping_id(),
- active->pid > 0 || this->ping_external_,
- svrobj.in());
- }
- else
- {
- active->reset_runtime ();
- }
-
}
//only after verifying do we report the IOR and become open for business
@@ -553,6 +537,7 @@ ImR_Locator_i::spawn_pid
if (! info.null ())
{
info.edit ()->active_info ()->pid = pid;
+ info.edit ()->active_info ()->death_notify = true;
}
else
{
@@ -1426,7 +1411,7 @@ ImR_Locator_i::connect_server (UpdateableServerInfo& info)
}
bool
-ImR_Locator_i::is_alive (UpdateableServerInfo& info)
+ImR_Locator_i::server_is_alive (UpdateableServerInfo& info)
{
this->connect_server (info);
SyncListener *listener = 0;
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h
index dbfa93c5a44..882aead7a13 100644
--- a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h
@@ -181,17 +181,17 @@ private:
bool manual_start,
ImR_ResponseHandler *rh);
- bool is_alive(UpdateableServerInfo& info);
+ bool server_is_alive (UpdateableServerInfo& info);
- void unregister_activator_i(const char* activator);
+ void unregister_activator_i (const char* activator);
void connect_activator (Activator_Info& info);
- void auto_start_servers(void);
+ void auto_start_servers (void);
- void connect_server(UpdateableServerInfo& info);
+ void connect_server (UpdateableServerInfo& info);
- PortableServer::POA_ptr findPOA(const char* name);
+ PortableServer::POA_ptr findPOA (const char* name);
private:
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
index 410f6acef84..30e968b63ef 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
@@ -613,7 +613,6 @@ Locator_Repository::has_activator (const ACE_CString& name)
return activators().find (lcase (name), activator) == 0;
}
-
int
Locator_Repository::remove_activator (const ACE_CString& name)
{
@@ -629,6 +628,18 @@ Locator_Repository::remove_activator (const ACE_CString& name)
return ret;
}
+ Locator_Repository::SIMap::ENTRY* sientry = 0;
+ Locator_Repository::SIMap::ITERATOR siit (servers ());
+ for (; siit.next (sientry); siit.advance() )
+ {
+ Server_Info *info = sientry->int_id_->active_info ();
+
+ if (info->death_notify && info->activator == name)
+ {
+ info->death_notify = false;
+ }
+ }
+
return persistent_remove(name, true);
}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp b/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp
index 00f46a22f7d..6d2d824e031 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp
@@ -32,6 +32,7 @@ Server_Info::operator= (const Server_Info &other)
waiting_clients = other.waiting_clients;
starting = other.starting;
pid = other.pid;
+ death_notify = other.death_notify;
peers = other.peers;
env_vars = other.env_vars;
return *this;
@@ -66,6 +67,7 @@ Server_Info::Server_Info (const ACE_CString& fqname,
, waiting_clients (0)
, starting (false)
, pid (0)
+ , death_notify (false)
{
this->is_jacorb = parse_id (fqname.c_str(), this->server_id, this->poa_name);
Server_Info::gen_key (this->server_id, this->poa_name, this->key_name_);
@@ -95,6 +97,7 @@ Server_Info::Server_Info (const ACE_CString& serverId,
, waiting_clients (0)
, starting (false)
, pid (0)
+ , death_notify (false)
{
Server_Info::gen_key (this->server_id, this->poa_name, this->key_name_);
}
@@ -272,6 +275,7 @@ Server_Info::clear (void)
waiting_clients = 0;
starting = false;
pid = 0;
+ death_notify = false;
}
void
@@ -281,6 +285,7 @@ Server_Info::reset_runtime (void)
Server_Info *startup = this->active_info ();
startup->ior = "";
startup->pid = 0;
+ startup->death_notify = false;
startup->last_ping = ACE_Time_Value::zero;
startup->server = ImplementationRepository::ServerObject::_nil ();
}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Server_Info.h b/TAO/orbsvcs/ImplRepo_Service/Server_Info.h
index c2f1a4e5fa7..9676bd01501 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Server_Info.h
+++ b/TAO/orbsvcs/ImplRepo_Service/Server_Info.h
@@ -129,8 +129,11 @@ struct Server_Info
int start_count;
int waiting_clients;
bool starting;
- int pid;
+ /// Last known process ID reported by the activator
+ int pid;
+ /// the locator should expect a notification on server death from activator
+ bool death_notify;
};
#endif /* SERVER_INFO_H */
diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartIMR/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/RestartIMR/run_test.pl
index fe523644624..fa6d30ff67c 100755
--- a/TAO/orbsvcs/tests/ImplRepo/RestartIMR/run_test.pl
+++ b/TAO/orbsvcs/tests/ImplRepo/RestartIMR/run_test.pl
@@ -26,6 +26,7 @@ my $server_pid = 0;
my $kill_svr = 0;
my $kill_act = 0;
+my $kill_imr = 1;
my $imr_debug = "-d 1 ";
my $act_debug = "";
@@ -40,11 +41,13 @@ foreach my $i (@ARGV) {
}
elsif ($i eq '-kill_act') {
$kill_act = 1;
- $kill_svr = 1;
}
elsif ($i eq '-kill_server') {
$kill_svr = 1;
}
+ elsif ($i eq '-no_kill_imr') {
+ $kill_imr = 0;
+ }
elsif ($i eq '-noid') {
$srv_id = "";
$srv_id_cmd = "";
@@ -131,7 +134,7 @@ $TI = $ti->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_imr");
$initref = "-ORBInitRef ImplRepoService=file://$ti_imriorfile";
$IMR->Arguments ("-ORBEndpoint iiop://:$port ".
- "-UnregisterIfAddressReused $imr_debug".
+ "-i -UnregisterIfAddressReused $imr_debug".
"--directory $persist_dir " .
$ping_ext .
"-o $imr_imriorfile ");
@@ -220,15 +223,17 @@ if ($srv->GetFile ($srvpidfile) == -1) {
}
print STDERR "=== list pre-kill\n";
-$TI->Arguments ("$initref list -v");
+$TI->Arguments ("$initref list -a");
$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
if ($TI_status != 0) {
print STDERR "tao_imr list poaC to poaA returned $TI_status\n";
}
-print STDERR "=== kill ImR Locator\n";
-$IMR_status = $IMR->TerminateWaitKill ($imr->ProcessStopWaitInterval());
-$imr->DeleteFile ($imriorfile);
+if ($kill_imr == 1) {
+ print STDERR "=== kill ImR Locator\n";
+ $IMR_status = $IMR->TerminateWaitKill ($imr->ProcessStopWaitInterval());
+ $imr->DeleteFile ($imriorfile);
+}
if ($kill_act == 1) {
print STDERR "=== kill ImR Activator\n";
@@ -243,16 +248,18 @@ if ($kill_svr == 1) {
$srv->DeleteFile ($srvpidfile);
}
-print STDERR "=== restart ImR Locator\n";
-$IMR_status = $IMR->Spawn ();
-if ($IMR_status != 0) {
- print STDERR "ERROR: ImplRepo Service returned $IMR_status\n";
- exit 1;
-}
-if ($imr->WaitForFileTimed ($imriorfile,$imr->ProcessStartWaitInterval()) == -1) {
- print STDERR "ERROR: cannot find file <$imr_imriorfile>\n";
- $IMR->Kill (); $IMR->TimedWait (1);
- exit 1;
+if ($kill_imr == 1) {
+ print STDERR "=== restart ImR Locator\n";
+ $IMR_status = $IMR->Spawn ();
+ if ($IMR_status != 0) {
+ print STDERR "ERROR: ImplRepo Service returned $IMR_status\n";
+ exit 1;
+ }
+ if ($imr->WaitForFileTimed ($imriorfile,$imr->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$imr_imriorfile>\n";
+ $IMR->Kill (); $IMR->TimedWait (1);
+ exit 1;
+ }
}
if ($kill_act == 1) {
@@ -272,22 +279,40 @@ if ($kill_act == 1) {
}
}
-print STDERR "=== restart server via ImR\n";
-$TI->Arguments ("$initref start $poaA ");
+print STDERR "=== post restart list (1)\n";
+$TI->Arguments ("$initref list -v");
$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
if ($TI_status != 0) {
- print STDERR "tao_imr start $poaA returned $TI_status\n";
+ print STDERR "tao_imr list returned $TI_status\n";
}
-$TI->Arguments ("$initref list -v");
+
+
+if ($kill_svr == 1) {
+ print STDERR "=== restart server via ImR\n";
+ $TI->Arguments ("$initref start $poaA ");
+ $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
+ if ($TI_status != 0) {
+ print STDERR "tao_imr start $poaA returned $TI_status\n";
+ }
+}
+
+print STDERR "=== post restart list (2)\n";
+$TI->Arguments ("$initref list -a -v");
$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
if ($TI_status != 0) {
print STDERR "tao_imr list returned $TI_status\n";
}
-$TI->Arguments ("$initref shutdown $poaA ");
+print STDERR "=== shutdown\n";
+$TI->Arguments ("$initref kill $poaA ");
$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
if ($TI_status != 0) {
- print STDERR "tao_imr shutdown $poaA returned $TI_status\n";
+ print STDERR "tao_imr kill $poaA returned $TI_status\n";
+ $TI->Arguments ("$initref shutdown $poaA ");
+ $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
+ if ($TI_status != 0) {
+ print STDERR "tao_imr shutdown $poaA returned $TI_status\n";
+}
}
$ACT_status = $ACT->TerminateWaitKill ($act->ProcessStopWaitInterval());