Skip to content

Commit

Permalink
added log for empty load assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
nastassia-dailidava committed Dec 17, 2024
1 parent a796b9b commit d3f490d
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,7 @@ class EnvoySnapshotFactory(
// ClusterLoadAssignments many times - it may reduce MEM, CPU and latency if some serviceTags are
// commonly used
endpointsFactory.filterEndpoints(endpoints, routeSpec.settings.routingPolicy).let {
endpointsFactory.assignLocalityWeights(routeSpec, it).also { la ->
if (la.endpointsList.any { el -> el.lbEndpointsList.isEmpty() } &&
routeSpec.settings.routingPolicy.autoServiceTag) {
logger.warn(
"ClusterLoadAssignment for ${routeSpec.clusterName} has empty lbEndpoints, " +
"original clusterLoadAssignment: $endpoints"
)
}
}
endpointsFactory.assignLocalityWeights(routeSpec, it)
}
}
}
Expand Down Expand Up @@ -345,7 +337,16 @@ class EnvoySnapshotFactory(
val endpoints = getServicesEndpointsForGroup(
group.proxySettings.incoming.rateLimitEndpoints, globalSnapshot,
egressRouteSpecification
)
).also { e ->
val list = e.mapNotNull { el -> el.endpointsList.find { x -> x.lbEndpointsList.isEmpty() } }
if (list.isNotEmpty() &&
group.proxySettings.outgoing.defaultServiceSettings.routingPolicy.autoServiceTag) {
logger.warn(
"Some of service ${group.serviceName} dependencies have ClusterLoadAssignment with empty " +
"lbEndpoints: $list"
)
}
}

val version = snapshotsVersions.version(group, clusters, endpoints, listeners, routes)
return createSnapshot(
Expand Down

0 comments on commit d3f490d

Please sign in to comment.