@@ -306,6 +306,8 @@ public void checkLBAlgorithmName(String lbAlgorithm) {
306306 public void propagateMSListToAgents () {
307307 logger .debug ("Propagating management server list update to agents" );
308308 ExecutorService setupMSListExecutorService = Executors .newFixedThreadPool (10 , new NamedThreadFactory ("SetupMSList-Worker" ));
309+ final String lbAlgorithm = getLBAlgorithmName ();
310+ final Long globalLbCheckInterval = getLBPreferredHostCheckInterval (null );
309311 List <DataCenterVO > zones = dataCenterDao .listAll ();
310312 for (DataCenterVO zone : zones ) {
311313 List <Long > zoneHostIds = new ArrayList <>();
@@ -320,16 +322,14 @@ public void propagateMSListToAgents() {
320322 }
321323 zoneHostIds .sort (Comparator .comparingLong (x -> x ));
322324 final List <String > avoidMsList = mshostDao .listNonUpStateMsIPs ();
323- final String lbAlgorithm = getLBAlgorithmName ();
324- Long lbCheckInterval = getLBPreferredHostCheckInterval (null );
325325 for (Long nonRoutingHostId : nonRoutingHostIds ) {
326- setupMSListExecutorService .submit (new SetupMSListTask (nonRoutingHostId , zone .getId (), zoneHostIds , avoidMsList , lbAlgorithm , lbCheckInterval ));
326+ setupMSListExecutorService .submit (new SetupMSListTask (nonRoutingHostId , zone .getId (), zoneHostIds , avoidMsList , lbAlgorithm , globalLbCheckInterval ));
327327 }
328328 for (Long clusterId : clusterIds ) {
329- lbCheckInterval = getLBPreferredHostCheckInterval (clusterId );
329+ final Long clusterLbCheckInterval = getLBPreferredHostCheckInterval (clusterId );
330330 List <Long > hostIds = clusterHostIdsMap .get (clusterId );
331331 for (Long hostId : hostIds ) {
332- setupMSListExecutorService .submit (new SetupMSListTask (hostId , zone .getId (), zoneHostIds , avoidMsList , lbAlgorithm , lbCheckInterval ));
332+ setupMSListExecutorService .submit (new SetupMSListTask (hostId , zone .getId (), zoneHostIds , avoidMsList , lbAlgorithm , clusterLbCheckInterval ));
333333 }
334334 }
335335 }
0 commit comments