Commit b42583a8 authored by Marc Gravell's avatar Marc Gravell

Avoid race condition when adding servers

parent 3fca0020
......@@ -1222,10 +1222,14 @@ internal async Task<bool> ReconfigureAsync(bool first, bool reconfigureAll, Text
serverSnapshot = new ServerEndPoint[configuration.EndPoints.Count];
foreach (var endpoint in configuration.EndPoints)
{
var server = new ServerEndPoint(this, endpoint, log);
serverSnapshot[index++] = server;
var server = (ServerEndPoint)servers[endpoint];
if (server == null)
{
server = new ServerEndPoint(this, endpoint, log);
servers.Add(endpoint, server);
}
serverSnapshot[index++] = server;
}
}
foreach (var server in serverSnapshot)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment