1
0
Fork 0

unregister ourselves on shutdown

This commit is contained in:
Jan Steemann 2014-01-21 11:44:53 +01:00
parent 2e3f293012
commit 1a1e1ed645
1 changed files with 11 additions and 1 deletions

View File

@ -401,8 +401,18 @@ void ApplicationCluster::stop () {
{
AgencyCommLocker locker("Current", "WRITE");
if (locker.successful()) {
// unregister ourselves
ServerState::RoleEnum role = ServerState::instance()->getRole();
if (role == ServerState::ROLE_PRIMARY) {
comm.removeValues("Current/DBServers/" + _myId, false);
}
else if (role == ServerState::ROLE_COORDINATOR) {
comm.removeValues("Current/Coordinators/" + _myId, false);
}
// unregister ourselves
comm.removeValues("Current/ServersRegistered/" + _myId, false);
}