From ea21d88d307d7660d054cf052f061ddb37c61763 Mon Sep 17 00:00:00 2001 From: Saetch Date: Mon, 1 Jul 2024 11:45:23 +0200 Subject: [PATCH] added short delay for node startup in kubernetes --- Cluster/Node_cs/ApiConfig.cs | 3 +++ Cluster/coordinator/src/deal_with_nodes.rs | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Cluster/Node_cs/ApiConfig.cs b/Cluster/Node_cs/ApiConfig.cs index 47dd86f..65f34a0 100644 --- a/Cluster/Node_cs/ApiConfig.cs +++ b/Cluster/Node_cs/ApiConfig.cs @@ -1,5 +1,6 @@ using System.Collections.Concurrent; +using System.Collections.Specialized; using System.Diagnostics; using System.Net; using System.Net.Sockets; @@ -57,6 +58,8 @@ public int initializeConfigValues() Console.WriteLine("Pod IP: " + podIP); this.hostname = podIP; } + System.Threading.Thread.Sleep(5000); + } catch (Exception ex) { diff --git a/Cluster/coordinator/src/deal_with_nodes.rs b/Cluster/coordinator/src/deal_with_nodes.rs index 29bb3a6..6958c81 100644 --- a/Cluster/coordinator/src/deal_with_nodes.rs +++ b/Cluster/coordinator/src/deal_with_nodes.rs @@ -24,7 +24,6 @@ pub async fn redistribute_values(data: Arc, hash_value: u1 }); let to_distribute_from = if index != all_known_nodes.len()-1 {index + 1} else {0} ; //the values are distributed to the next hash value, so getting the next one after the current one yields the one that might have a share of values to redistribute let node_to_distribute_from = &all_known_nodes[to_distribute_from]; - let mut worked_communication = false; let mut response = Err(awc::error::SendRequestError::Timeout); for _ in 0..=6{ let url = format!("http://{}:5552/deleteSavedValuesBelow/{}", node_to_distribute_from.name, hash_value.to_string());