Skip to content
This repository has been archived by the owner on Jan 6, 2020. It is now read-only.

trying larger group size #27

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/maidsafe/routing/tests/routing_network.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ enum ExpectedNodeType {
kExpectDoesNotExist
};

const uint32_t kClientSize(5);
const uint32_t kServerSize(20);
const uint32_t kClientSize(3);
const uint32_t kServerSize(35);
const uint32_t kNetworkSize = kClientSize + kServerSize;

class GenericNetwork;
Expand Down
8 changes: 4 additions & 4 deletions src/maidsafe/routing/parameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ namespace routing {

unsigned int Parameters::thread_count(8);
unsigned int Parameters::num_chunks_to_cache(100);
unsigned int Parameters::closest_nodes_size(16);
unsigned int Parameters::group_size(4);
unsigned int Parameters::closest_nodes_size(32);
unsigned int Parameters::group_size(32);
unsigned int Parameters::proximity_factor(2);
unsigned int Parameters::max_routing_table_size(64);
unsigned int Parameters::routing_table_size_threshold(max_routing_table_size / 4);
unsigned int Parameters::max_routing_table_size_for_client(8);
unsigned int Parameters::max_client_routing_table_size(max_routing_table_size);
unsigned int Parameters::bucket_target_size(1);
std::chrono::steady_clock::duration Parameters::default_response_timeout(std::chrono::seconds(10));
std::chrono::steady_clock::duration Parameters::default_response_timeout(std::chrono::seconds(20));
std::chrono::seconds Parameters::find_node_interval(10);
std::chrono::seconds Parameters::recovery_time_lag(5);
std::chrono::seconds Parameters::re_bootstrap_time_lag(10);
Expand All @@ -47,7 +47,7 @@ unsigned int Parameters::maximum_find_close_node_failures(10);
unsigned int Parameters::max_route_history(3);
unsigned int Parameters::hops_to_live(50);
unsigned int Parameters::accepted_distance_tolerance(1);
unsigned int Parameters::unidirectional_interest_range(Parameters::closest_nodes_size * 2);
unsigned int Parameters::unidirectional_interest_range(Parameters::closest_nodes_size);
std::chrono::steady_clock::duration Parameters::local_retreival_timeout(std::chrono::seconds(2));
unsigned int Parameters::routing_table_ready_to_response(Parameters::max_routing_table_size / 2);
bptime::time_duration Parameters::connect_rpc_prune_timeout(
Expand Down
2 changes: 1 addition & 1 deletion src/maidsafe/routing/routing_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ void Routing::Impl::Send(const NodeId& destination_id, const std::string& data,
unsigned int expected_response_count(1);
if (response_functor) {
if (DestinationType::kGroup == destination_type)
expected_response_count = 4;
expected_response_count = Parameters::group_size;
proto_message.set_id(timer_.NewTaskId());
timer_.AddTask(Parameters::default_response_timeout, response_functor, expected_response_count,
proto_message.id());
Expand Down
8 changes: 4 additions & 4 deletions src/maidsafe/routing/tests/routing_network.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ testing::AssertionResult GenericNetwork::SendDirect(size_t repeats, size_t messa

std::unique_lock<std::mutex> lock(*response_mutex);
if (!cond_var->wait_for(
lock, std::chrono::seconds(15 * (nodes_.size()) * (nodes_.size() - 1)),
lock, std::chrono::seconds(25 * (nodes_.size()) * (nodes_.size() - 1)),
[reply_count, expected_count]() { return *reply_count == *expected_count; })) {
ADD_FAILURE() << "Didn't get reply within allowed time!";
return testing::AssertionFailure();
Expand Down Expand Up @@ -1234,7 +1234,7 @@ testing::AssertionResult GenericNetwork::SendGroup(const NodeId& target_id, size

std::unique_lock<std::mutex> lock(*response_mutex);
if (!cond_var->wait_for(
lock, std::chrono::seconds(15 * repeats),
lock, std::chrono::seconds(25 * repeats),
[reply_count, expected_count]() { return *reply_count == *expected_count; })) {
ADD_FAILURE() << "Didn't get replies within allowed time!";
return testing::AssertionFailure();
Expand Down Expand Up @@ -1344,7 +1344,7 @@ testing::AssertionResult GenericNetwork::SendDirect(const NodeId& destination_no
}

std::unique_lock<std::mutex> lock(*response_mutex);
if (!cond_var->wait_for(lock, std::chrono::seconds(15), [reply_count, expected_count]() {
if (!cond_var->wait_for(lock, std::chrono::seconds(25), [reply_count, expected_count]() {
return *reply_count == *expected_count;
})) {
// ADD_FAILURE() << "Didn't get reply within allowed time!";
Expand Down Expand Up @@ -1400,7 +1400,7 @@ testing::AssertionResult GenericNetwork::SendDirect(std::shared_ptr<GenericNode>
source_node->SendDirect(destination_node_id, data, false, response_functor);

std::unique_lock<std::mutex> lock(*response_mutex);
if (cond_var->wait_for(lock, std::chrono::seconds(15)) != std::cv_status::no_timeout) {
if (cond_var->wait_for(lock, std::chrono::seconds(25)) != std::cv_status::no_timeout) {
ADD_FAILURE() << "Didn't get reply within allowed time!";
return testing::AssertionFailure();
}
Expand Down