Skip to content

Commit

Permalink
fix(sdk-dotnet): Fix rebalance when the boostrap sever is down and th…
Browse files Browse the repository at this point in the history
…en up
  • Loading branch information
KarlaCarvajal committed Dec 13, 2024
1 parent 8c89187 commit 5eba573
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private void DoHeartBeat()
catch (Exception ex)
{
_logger?.LogError(ex, $"Failed contacting bootstrap host {_config.BootstrapHost}:{_config.BootstrapPort}");
_runningConnections = new List<LHServerConnection<T>>();
}
}

Expand Down Expand Up @@ -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}");
Expand Down

0 comments on commit 5eba573

Please sign in to comment.