1
0
Fork 0

Fix unfinished gossips

This commit is contained in:
Kaveh Vahedipour 2016-11-02 11:36:57 +01:00
parent da687f8f53
commit 8b99d8995a
2 changed files with 12 additions and 6 deletions

View File

@ -50,7 +50,7 @@ void Inception::gossip() {
auto s = std::chrono::system_clock::now();
std::chrono::seconds timeout(120);
size_t i = 0;
size_t n = 0, j = 0;
CONDITION_LOCKER(guard, _cv);
@ -75,7 +75,7 @@ void Inception::gossip() {
// gossip peers
for (auto const& p : config.gossipPeers()) {
if (p != config.endpoint()) {
std::string clientid = config.id() + std::to_string(i++);
std::string clientid = config.id() + std::to_string(j++);
auto hf =
std::make_unique<std::unordered_map<std::string, std::string>>();
arangodb::ClusterComm::instance()->asyncRequest(
@ -88,7 +88,7 @@ void Inception::gossip() {
// pool entries
for (auto const& pair : config.pool()) {
if (pair.second != config.endpoint()) {
std::string clientid = config.id() + std::to_string(i++);
std::string clientid = config.id() + std::to_string(j++);
auto hf =
std::make_unique<std::unordered_map<std::string, std::string>>();
arangodb::ClusterComm::instance()->asyncRequest(
@ -114,8 +114,11 @@ void Inception::gossip() {
// We're done
if (config.poolComplete()) {
_agent->startConstituent();
break;
if (n > 5) {
_agent->startConstituent();
break;
}
++n;
}
}

View File

@ -326,7 +326,10 @@ void AgencyCommResult::clear() {
/// get results of query as slice
////////////////////////////////////////////////////////////////////////////////
VPackSlice AgencyCommResult::slice() { return _vpack->slice(); }
VPackSlice AgencyCommResult::slice() {
TRI_ASSERT(_vpack != nullptr);
return _vpack->slice();
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the static global URL prefix