GabrielCWT commented on code in PR #18591:
URL: https://github.com/apache/druid/pull/18591#discussion_r2467735906


##########
extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesTaskRunner.java:
##########
@@ -132,10 +142,12 @@ public KubernetesTaskRunner(
     this.httpClient = httpClient;
     this.peonLifecycleFactory = peonLifecycleFactory;
     this.cleanupExecutor = Executors.newScheduledThreadPool(1);
-    this.exec = MoreExecutors.listeningDecorator(
-        Execs.multiThreaded(config.getCapacity(), "k8s-task-runner-%d")
-    );
     this.emitter = emitter;
+
+    this.currentCapacity = config.getCapacity();
+    this.tpe = new ThreadPoolExecutor(currentCapacity, currentCapacity, 0L, 
TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), 
Execs.makeThreadFactory("k8s-task-runner-%d", null));
+    this.exec = MoreExecutors.listeningDecorator(this.tpe);
+    configManager.addListener(KubernetesTaskRunnerDynamicConfig.CONFIG_KEY, 
StringUtils.format(OBSERVER_KEY, Thread.currentThread().getId()), 
this::syncCapacityWithDynamicConfig);

Review Comment:
   Yes it will run in the same thread as the one handling the API call. Would 
your concern be that if more listeners were to be added in the future, the 
updating of dynamic configs would be a long blocking call? 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to