Skip to content

Commit a2c907f

Browse files
authored
Fix race when using shared config (#1714)
1 parent 24245fd commit a2c907f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Grpc.Net.Client/Balancer/Internal/ConnectionManager.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ namespace Grpc.Net.Client.Balancer.Internal
3434
{
3535
internal sealed class ConnectionManager : IDisposable, IChannelControlHelper
3636
{
37-
private static readonly ServiceConfig DefaultServiceConfig = new ServiceConfig();
38-
3937
private readonly object _lock;
4038
internal readonly Resolver _resolver;
4139
private readonly ISubchannelTransportFactory _subchannelTransportFactory;
@@ -141,8 +139,8 @@ private void OnResolverResult(ResolverResult result)
141139
if (result.ServiceConfigStatus == null)
142140
{
143141
// Step 5: Use default service config if none is provided.
144-
_previousServiceConfig = DefaultServiceConfig;
145-
workingServiceConfig = DefaultServiceConfig;
142+
workingServiceConfig = new ServiceConfig();
143+
_previousServiceConfig = workingServiceConfig;
146144
}
147145
else
148146
{

0 commit comments

Comments
 (0)