mridulm commented on code in PR #51913:
URL: https://github.com/apache/spark/pull/51913#discussion_r2344654185
##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocator.scala:
##########
@@ -71,6 +71,8 @@ class ExecutorPodsAllocator(
protected val maxPendingPods = conf.get(KUBERNETES_MAX_PENDING_PODS)
+ protected val maxPendingPodsPerRpid =
conf.get(KUBERNETES_MAX_PENDING_PODS_PER_RPID)
Review Comment:
Enforce this is <= `maxPendingPods`
##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocator.scala:
##########
@@ -363,10 +365,14 @@ class ExecutorPodsAllocator(
if (remainingSlotFromPendingPods > 0 && podsToAllocateWithRpId.size > 0 &&
!(snapshots.isEmpty && podAllocOnPVC && maxPVCs <= PVC_COUNTER.get()))
{
ExecutorPodsAllocator.splitSlots(podsToAllocateWithRpId,
remainingSlotFromPendingPods)
- .foreach { case ((rpId, podCountForRpId, targetNum),
sharedSlotFromPendingPods) =>
+ .foreach { case ((rpId, podCountForRpId, targetNum,
pendingPodCountForRpId),
+ sharedSlotFromPendingPods) =>
+ val remainingSlotsForRpId = maxPendingPodsPerRpid -
pendingPodCountForRpId
val numMissingPodsForRpId = targetNum - podCountForRpId
val numExecutorsToAllocate =
- math.min(math.min(numMissingPodsForRpId, podAllocationSize),
sharedSlotFromPendingPods)
+ math.min(math.min(math.min(numMissingPodsForRpId, podAllocationSize),
+ sharedSlotFromPendingPods), remainingSlotsForRpId)
Review Comment:
nit:
```suggestion
Seq(numMissingPodsForRpId, podAllocationSize,
sharedSlotFromPendingPods, remainingSlotsForRpId).min
```
--
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]