YongGang commented on code in PR #14771:
URL: https://github.com/apache/druid/pull/14771#discussion_r1293717233


##########
extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesTaskRunner.java:
##########
@@ -370,13 +370,13 @@ public Optional<ScalingStats> getScalingStats()
   @Override
   public Map<String, Long> getIdleTaskSlotCount()
   {
-    return Collections.emptyMap();
+    return ImmutableMap.of(WORKER_CATEGORY, Long.valueOf(config.getCapacity() 
- tasks.size()));

Review Comment:
   In `K8sTaskRunner` the task lifecycle is different from other type of 
`runners`, for example task is only in pending status if K8s runner submit the 
job already while in other `runners` task is set to pending immediately after 
it handled by the runner.
   So in other `runners` we can check the number of pending tasks to see if the 
cluster is under provisioned but in K8sTaskRunner we have no visibility on 
this, thus here I reuse the `taskSlot/idle/count` metric to indicate that.
   
   Or we can make the task lifecycle in `K8sTaskRunner` more align with other 
runners, e.g. if task is queued in thread pool then it's in pending status, if 
K8s submit the job then it's in running status. 



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