File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1854,7 +1854,13 @@ generation::ServiceSize generation::rebuild_service_ring_one_wrr(
18541854 const balancer_service_t & service)
18551855{
18561856 balancer_real_id_t * end = start;
1857- balancer_real_id_t * reserve = start + YANET_BALANCER_WRR_SERVICE_SIZE;
1857+ const auto service_size = service.real_size * YANET_CONFIG_BALANCER_REAL_WEIGHT_MAX;
1858+ balancer_real_id_t * reserve = start + service_size;
1859+ if (reserve > do_not_exceed)
1860+ {
1861+ reserve = do_not_exceed;
1862+ YANET_LOG_ERROR (" Balancer exceeded service ring size. Service ring chunck clamped to limit.\n " );
1863+ }
18581864 for (uint32_t real_idx = service.real_start ;
18591865 real_idx < service.real_start + service.real_size ;
18601866 ++real_idx)
You can’t perform that action at this time.
0 commit comments