Bugfix: use service identity rather than just their names.

This commit is contained in:
Gunnar Beutner 2012-06-22 12:22:36 +02:00
parent e294cf6686
commit 69d3e71b03
3 changed files with 11 additions and 11 deletions

View File

@ -76,7 +76,7 @@ void CheckerComponent::CheckTimerHandler(void)
Application::Log(LogDebug, "checker", "Executing service check for '" + service.GetName() + "'");
m_PendingServices.insert(service.GetName());
m_PendingServices.insert(service.GetConfigObject());
CheckTask::Ptr task = CheckTask::CreateTask(service);
task->Enqueue();
@ -111,7 +111,7 @@ void CheckerComponent::ResultTimerHandler(void)
/* if the service isn't in the set of pending services
* it was removed and we need to ignore this check result. */
if (m_PendingServices.find(service.GetName()) == m_PendingServices.end())
if (m_PendingServices.find(service.GetConfigObject()) == m_PendingServices.end())
continue;
CheckResult result = task->GetResult();
@ -132,7 +132,7 @@ void CheckerComponent::ResultTimerHandler(void)
failed++;
service.SetNextCheck(now + service.GetCheckInterval());
m_PendingServices.erase(service.GetName());
m_PendingServices.erase(service.GetConfigObject());
m_Services.push(service);
}

View File

@ -51,7 +51,7 @@ private:
VirtualEndpoint::Ptr m_CheckerEndpoint;
ServiceQueue m_Services;
set<string> m_PendingServices;
set<ConfigObject::Ptr> m_PendingServices;
Timer::Ptr m_CheckTimer;

View File

@ -235,6 +235,13 @@ void DelegationComponent::DelegationTimerHandler(void)
assert(candidates.size() == 0 || !service.GetChecker().empty());
}
map<Endpoint::Ptr, int>::iterator hit;
for (hit = histogram.begin(); hit != histogram.end(); hit++) {
stringstream msgbuf;
msgbuf << "histogram: " << hit->first->GetIdentity() << " - " << hit->second;
Application::Log(LogInformation, "delegation", msgbuf.str());
}
if (delegated > 0) {
if (need_clear) {
map<Endpoint::Ptr, int>::iterator hit;
@ -252,13 +259,6 @@ void DelegationComponent::DelegationTimerHandler(void)
AssignService(endpoint, *sit);
}
map<Endpoint::Ptr, int>::iterator hit;
for (hit = histogram.begin(); hit != histogram.end(); hit++) {
stringstream msgbuf;
msgbuf << "histogram: " << hit->first->GetIdentity() << " - " << hit->second;
Application::Log(LogInformation, "delegation", msgbuf.str());
}
}
stringstream msgbuf;