1996fanrui commented on code in PR #744:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/744#discussion_r1440384519


##########
flink-autoscaler-standalone/src/main/java/org/apache/flink/autoscaler/standalone/StandaloneAutoscalerExecutor.java:
##########
@@ -75,29 +98,38 @@ public void start() {
     @Override
     public void close() {
         scheduledExecutorService.shutdownNow();
+        scalingThreadPool.shutdownNow();
     }
 
     @VisibleForTesting
     protected void scaling() {
         LOG.info("Standalone autoscaler starts scaling.");
         try {
             var jobList = jobListFetcher.fetch();
+            Collection<Future<?>> futures = new LinkedList<>();
             for (var jobContext : jobList) {
-                try {
-                    autoScaler.scale(jobContext);
-                } catch (Throwable e) {
-                    LOG.error("Error while scaling job", e);
-                    eventHandler.handleEvent(
-                            jobContext,
-                            AutoScalerEventHandler.Type.Warning,
-                            AUTOSCALER_ERROR,
-                            e.getMessage(),
-                            null,
-                            null);
-                }
+                futures.add(scalingThreadPool.submit(() -> 
scalingSingleJob(jobContext)));
+            }
+            for (Future<?> future : futures) {
+                future.get();
             }
         } catch (Throwable e) {
             LOG.error("Error while fetch job list.", e);
         }

Review Comment:
   Updated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to