You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/04/03 16:39:48 UTC

[GitHub] [flink] tillrohrmann commented on a change in pull request #11353: [FLINK-16438][yarn] Make YarnResourceManager starts workers using WorkerResourceSpec requested by SlotManager

tillrohrmann commented on a change in pull request #11353: [FLINK-16438][yarn] Make YarnResourceManager starts workers using WorkerResourceSpec requested by SlotManager
URL: https://github.com/apache/flink/pull/11353#discussion_r403086625
 
 

 ##########
 File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesResourceManager.java
 ##########
 @@ -183,16 +178,18 @@ public boolean stopWorker(final KubernetesWorkerNode worker) {
 	@Override
 	public void onAdded(List<KubernetesPod> pods) {
 		runAsync(() -> {
-			for (KubernetesPod pod : pods) {
-				if (numPendingPodRequests > 0) {
-					numPendingPodRequests--;
+			pods.forEach(pod -> {
+				WorkerResourceSpec workerResourceSpec = podWorkerResources.get(pod.getName());
+				final int pendingNum = pendingWorkerCounter.getNum(workerResourceSpec);
+				if (pendingNum > 0) {
+					pendingWorkerCounter.decreaseAndGet(workerResourceSpec);
 
 Review comment:
   I'm wondering whether this logic shouldn't go into the `ActiveResourceManager`. I would expect that all `ActiveResourceManager` implementations would need to do something similar. Maybe we could introduce `notifyNewWorkerStarted(WorkerResourceSpec)`. This could also have the benefit that we could hide `pendingWorkerCounter` completely.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services