From 5eba57371649d29a4865d64539d282937fedf057 Mon Sep 17 00:00:00 2001 From: KarlaCarvajal Date: Thu, 12 Dec 2024 20:17:20 -0500 Subject: [PATCH] fix(sdk-dotnet): Fix rebalance when the boostrap sever is down and then up --- .../Worker/Internal/LHServerConnectionManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk-dotnet/LittleHorse.Sdk/Worker/Internal/LHServerConnectionManager.cs b/sdk-dotnet/LittleHorse.Sdk/Worker/Internal/LHServerConnectionManager.cs index 2345e54d9..a5e827129 100644 --- a/sdk-dotnet/LittleHorse.Sdk/Worker/Internal/LHServerConnectionManager.cs +++ b/sdk-dotnet/LittleHorse.Sdk/Worker/Internal/LHServerConnectionManager.cs @@ -86,6 +86,7 @@ private void DoHeartBeat() catch (Exception ex) { _logger?.LogError(ex, $"Failed contacting bootstrap host {_config.BootstrapHost}:{_config.BootstrapPort}"); + _runningConnections = new List>(); } } @@ -115,7 +116,7 @@ private void HandleRegisterTaskWorkerResponse(RegisterTaskWorkerResponse respons for (int i = lastIndexOfRunningConnection; i >= 0; i--) { var runningThread = _runningConnections[i]; - + if (!ShouldBeRunning(runningThread, response.YourHosts)) { _logger?.LogInformation($"Stopping worker thread for host {runningThread.HostInfo.Host} : {runningThread.HostInfo.Port}");