From 5a9b14bfb2f8cbaf5fb9d256df8539996121dd0a Mon Sep 17 00:00:00 2001 From: moadeli Date: Fri, 26 Sep 2014 16:38:55 +0100 Subject: [PATCH 1/2] trying larger group size --- include/maidsafe/routing/tests/routing_network.h | 4 ++-- src/maidsafe/routing/parameters.cc | 6 +++--- src/maidsafe/routing/routing_impl.cc | 2 +- src/maidsafe/routing/tests/routing_network.cc | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/maidsafe/routing/tests/routing_network.h b/include/maidsafe/routing/tests/routing_network.h index cd997488..5fac733b 100644 --- a/include/maidsafe/routing/tests/routing_network.h +++ b/include/maidsafe/routing/tests/routing_network.h @@ -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; diff --git a/src/maidsafe/routing/parameters.cc b/src/maidsafe/routing/parameters.cc index bd271f45..7547b101 100644 --- a/src/maidsafe/routing/parameters.cc +++ b/src/maidsafe/routing/parameters.cc @@ -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); diff --git a/src/maidsafe/routing/routing_impl.cc b/src/maidsafe/routing/routing_impl.cc index e4c76cff..2d6c3357 100644 --- a/src/maidsafe/routing/routing_impl.cc +++ b/src/maidsafe/routing/routing_impl.cc @@ -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()); diff --git a/src/maidsafe/routing/tests/routing_network.cc b/src/maidsafe/routing/tests/routing_network.cc index 152046fa..67b2b5d3 100644 --- a/src/maidsafe/routing/tests/routing_network.cc +++ b/src/maidsafe/routing/tests/routing_network.cc @@ -1141,7 +1141,7 @@ testing::AssertionResult GenericNetwork::SendDirect(size_t repeats, size_t messa std::unique_lock 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(); @@ -1234,7 +1234,7 @@ testing::AssertionResult GenericNetwork::SendGroup(const NodeId& target_id, size std::unique_lock 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(); @@ -1344,7 +1344,7 @@ testing::AssertionResult GenericNetwork::SendDirect(const NodeId& destination_no } std::unique_lock 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!"; @@ -1400,7 +1400,7 @@ testing::AssertionResult GenericNetwork::SendDirect(std::shared_ptr source_node->SendDirect(destination_node_id, data, false, response_functor); std::unique_lock 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(); } From ecc1cc695321c6fd41e1300c0e9632e1abbc1cfb Mon Sep 17 00:00:00 2001 From: moadeli Date: Fri, 26 Sep 2014 17:40:17 +0100 Subject: [PATCH 2/2] changing unidirectional range --- src/maidsafe/routing/parameters.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/maidsafe/routing/parameters.cc b/src/maidsafe/routing/parameters.cc index 7547b101..96f58ba4 100644 --- a/src/maidsafe/routing/parameters.cc +++ b/src/maidsafe/routing/parameters.cc @@ -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(