mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
Feature #2665: Scheduler now tries to contact oned for ever...
This commit is contained in:
parent
77b51290eb
commit
c3f1eca676
@ -218,9 +218,8 @@ void Scheduler::start()
|
||||
// -------------------------------------------------------------------------
|
||||
// Get oned configuration, and init zone_id
|
||||
// -------------------------------------------------------------------------
|
||||
int tries = 0;
|
||||
|
||||
while (tries < 3)
|
||||
while (1)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -240,29 +239,28 @@ void Scheduler::start()
|
||||
|
||||
if (!success ||(oned_conf.from_xml(message) != 0))
|
||||
{
|
||||
ostringstream oss;
|
||||
oss << "Wrong oned response: " << message;
|
||||
ostringstream oss;
|
||||
|
||||
NebulaLog::log("SCHED", Log::WARNING, message);
|
||||
oss << "Cannot contact oned, will retry... Error: " << message;
|
||||
|
||||
tries++;
|
||||
NebulaLog::log("SCHED", Log::ERROR, oss);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
catch (exception const& e)
|
||||
{
|
||||
tries++;
|
||||
NebulaLog::log("SCHED", Log::WARNING, e.what());
|
||||
ostringstream oss;
|
||||
|
||||
oss << "Cannot contact oned, will retry... Error: " << e.what();
|
||||
|
||||
NebulaLog::log("SCHED", Log::ERROR, oss);
|
||||
}
|
||||
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
if (tries >= 3)
|
||||
{
|
||||
throw runtime_error("Error contacting oned, check sched.log");
|
||||
}
|
||||
NebulaLog::log("SCHED", Log::INFO, "oned successfully contacted.");
|
||||
|
||||
vector<const Attribute*> fed;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user