From 46a320b5b47708dcc64e3ee5ca354ecc30b851eb Mon Sep 17 00:00:00 2001 From: "nastassia.dailidava" Date: Mon, 16 Dec 2024 21:32:16 +0100 Subject: [PATCH] added log for empty load assignment --- .../envoycontrol/snapshot/EnvoySnapshotFactory.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt index 4e80857d7..c72de3d4b 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt @@ -281,7 +281,14 @@ 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) + endpointsFactory.assignLocalityWeights(routeSpec, it).also { la -> + if (la.endpointsList.any { el -> el.lbEndpointsList.isEmpty() }) { + logger.warn( + "ClusterLoadAssignment for ${routeSpec.clusterName} has empty lbEndpoints, " + + "original clusterLoadAssignment: ${endpoints.toString()}" + ) + } + } } } }