Skip to content
This repository was archived by the owner on Jan 17, 2024. It is now read-only.

Commit b37dd21

Browse files
Merge pull request #2 from ledjon-behluli/fix-same-index-selection-potential
Fixes problem of potentially selecting same silo via the same index
2 parents 7dcf56d + de74e27 commit b37dd21

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Orleans.BalancedResourcePlacement/BalancedResourcePlacementDirector.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public Task<SiloAddress> OnAddActivation(PlacementStrategy strategy, PlacementTa
5353
int index = Random.Shared.Next(relevantSilos.Count);
5454
var pickedSilo = relevantSilos[index];
5555

56+
relevantSilos.RemoveAt(index);
57+
5658
float score = CalculateScore(pickedSilo.Value);
5759
chooseFromSilos.Add(pickedSilo.Key, score);
5860
}

Orleans.BalancedResourcePlacement/WindowsEnvironmentStatistics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Orleans.BalancedResourcePlacement;
77

8-
internal class WindowsEnvironmentStatistics : IHostEnvironmentStatistics, ILifecycleObserver, IDisposable
8+
internal sealed class WindowsEnvironmentStatistics : IHostEnvironmentStatistics, ILifecycleObserver, IDisposable
99
{
1010
private readonly TimeSpan monitorPeriod;
1111

0 commit comments

Comments
 (0)