Mitigate double read locks on the layered profile

This commit is contained in:
Daniel
2022-08-02 13:59:13 +02:00
parent 0390ab55ab
commit 0b81fb5516
5 changed files with 27 additions and 14 deletions

View File

@@ -270,10 +270,10 @@ func checkEndpointListsForSystemResolverDNSRequests(ctx context.Context, conn *n
var profileEndpoints endpoints.Endpoints
var optionKey string
if conn.Inbound {
profileEndpoints = p.LocalProfile().GetServiceEndpoints()
profileEndpoints = p.LocalProfileWithoutLocking().GetServiceEndpoints()
optionKey = profile.CfgOptionServiceEndpointsKey
} else {
profileEndpoints = p.LocalProfile().GetEndpoints()
profileEndpoints = p.LocalProfileWithoutLocking().GetEndpoints()
optionKey = profile.CfgOptionEndpointsKey
}