From 5dfa0c0adbb3d97a7b27f187dca7d27620dc26a9 Mon Sep 17 00:00:00 2001 From: Kaveh Vahedipour Date: Mon, 6 Jun 2016 10:28:07 +0200 Subject: [PATCH 1/2] abolished const ref members in supervision jobs --- arangod/Agency/Store.cpp | 4 +-- arangod/Agency/Supervision.cpp | 64 ++++++++++++++++------------------ 2 files changed, 32 insertions(+), 36 deletions(-) diff --git a/arangod/Agency/Store.cpp b/arangod/Agency/Store.cpp index 0ff8040603..cc9447ed91 100644 --- a/arangod/Agency/Store.cpp +++ b/arangod/Agency/Store.cpp @@ -138,10 +138,10 @@ Store::~Store() {} std::vector Store::apply(query_t const& query) { std::vector applied; MUTEX_LOCKER(storeLocker, _storeLock); - for (auto const& i : VPackArrayIterator(query->slice())) { + /*for (auto const& i : VPackArrayIterator(query->slice())) { LOG(WARN) << i[0].typeName(); LOG(WARN) << i[0].keyAt(0).copyString(); - } + } */ for (auto const& i : VPackArrayIterator(query->slice())) { switch (i.length()) { case 1: diff --git a/arangod/Agency/Supervision.cpp b/arangod/Agency/Supervision.cpp index f861b778cc..0ed06087be 100644 --- a/arangod/Agency/Supervision.cpp +++ b/arangod/Agency/Supervision.cpp @@ -66,7 +66,7 @@ static std::string const planCoordinatorsPrefix = "/Plan/Coordinators"; std::vector Supervision::checkDBServers() { std::vector ret; - Node::Children const& machinesPlanned = + Node::Children const machinesPlanned = _snapshot(planDBServersPrefix).children(); for (auto const& machine : machinesPlanned) { @@ -138,7 +138,7 @@ std::vector Supervision::checkDBServers() { std::vector Supervision::checkCoordinators() { std::vector ret; - Node::Children const& machinesPlanned = + Node::Children const machinesPlanned = _snapshot(planCoordinatorsPrefix).children(); for (auto const& machine : machinesPlanned) { @@ -270,38 +270,34 @@ void Supervision::workJobs() { Node::Children const todos = _snapshot(toDoPrefix).children(); Node::Children const pends = _snapshot(pendingPrefix).children(); - if (!todos.empty()) { - for (auto const& todoEnt : todos) { - Node const& job = *todoEnt.second; - - try { - std::string jobType = job("type").getString(), - jobId = job("jobId").getString(), - creator = job("creator").getString(); - if (jobType == "failedServer") { - FailedServer fs(_snapshot, _agent, jobId, creator, _agencyPrefix); - } else if (jobType == "cleanOutServer") { - CleanOutServer cos(_snapshot, _agent, jobId, creator, _agencyPrefix); - } - } catch (std::exception const&) {} - } + for (auto const& todoEnt : todos) { + Node const& job = *todoEnt.second; + + try { + std::string jobType = job("type").getString(), + jobId = job("jobId").getString(), + creator = job("creator").getString(); + if (jobType == "failedServer") { + FailedServer fs(_snapshot, _agent, jobId, creator, _agencyPrefix); + } else if (jobType == "cleanOutServer") { + CleanOutServer cos(_snapshot, _agent, jobId, creator, _agencyPrefix); + } + } catch (std::exception const&) {} } - if (!pends.empty()) { - for (auto const& pendEnt : pends) { - Node const& job = *pendEnt.second; - - try { - std::string jobType = job("type").getString(), - jobId = job("jobId").getString(), - creator = job("creator").getString(); - if (jobType == "failedServer") { - FailedServer fs(_snapshot, _agent, jobId, creator, _agencyPrefix); - } else if (jobType == "cleanOutServer") { - CleanOutServer cos(_snapshot, _agent, jobId, creator, _agencyPrefix); - } - } catch (std::exception const&) {} - } + for (auto const& pendEnt : pends) { + Node const& job = *pendEnt.second; + + try { + std::string jobType = job("type").getString(), + jobId = job("jobId").getString(), + creator = job("creator").getString(); + if (jobType == "failedServer") { + FailedServer fs(_snapshot, _agent, jobId, creator, _agencyPrefix); + } else if (jobType == "cleanOutServer") { + CleanOutServer cos(_snapshot, _agent, jobId, creator, _agencyPrefix); + } + } catch (std::exception const&) {} } } @@ -349,7 +345,7 @@ void Supervision::getUniqueIds() { try { latestId = std::stoul( _agent->readDB().get(_agencyPrefix + "/Sync/LatestID").slice().toJson()); - } catch (std::exception const&) { + } catch (...) { std::this_thread::sleep_for (std::chrono::seconds(1)); continue; } @@ -375,7 +371,7 @@ void Supervision::getUniqueIds() { } void Supervision::updateFromAgency() { - auto const& jobsPending = + auto const jobsPending = _snapshot("/Supervision/Jobs/Pending").children(); for (auto const& jobent : jobsPending) { From 9fa9d4910293e50815e8affeb5dff31910ef4ac4 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 6 Jun 2016 10:28:52 +0200 Subject: [PATCH 2/2] Work around solaris integer / float comparison fault --- js/server/tests/aql/aql-functions-numeric.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/server/tests/aql/aql-functions-numeric.js b/js/server/tests/aql/aql-functions-numeric.js index 0d947f24b6..830d711562 100644 --- a/js/server/tests/aql/aql-functions-numeric.js +++ b/js/server/tests/aql/aql-functions-numeric.js @@ -46,6 +46,11 @@ function ahuacatlNumericFunctionsTestSuite () { if (typeof(b) === 'number') { b = b.toPrecision(8); } + if (((a === 0) && (b === 0.0))|| + ((b === 0) && (a === 0.0))) { + return; + } + assertEqual(a, b); }