xintongsong commented on a change in pull request #13592:
URL: https://github.com/apache/flink/pull/13592#discussion_r505185009
##########
File path:
flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManagerDriver.java
##########
@@ -260,36 +259,44 @@ public void releaseResource(YarnWorkerNode workerNode) {
// Internal
//
------------------------------------------------------------------------
- private void onContainersOfResourceAllocated(Resource resource,
List<Container> containers) {
- final List<TaskExecutorProcessSpec>
pendingTaskExecutorProcessSpecs =
-
taskExecutorProcessSpecContainerResourceAdapter.getTaskExecutorProcessSpec(resource,
matchingStrategy).stream()
- .flatMap(spec ->
Collections.nCopies(getNumRequestedNotAllocatedWorkersFor(spec), spec).stream())
- .collect(Collectors.toList());
+ private void onContainersOfPriorityAllocated(Priority priority,
List<Container> containers) {
+ final
Optional<TaskExecutorProcessSpecContainerResourcePriorityAdapter.TaskExecutorProcessSpecAndResource>
taskExecutorProcessSpecAndResourceOpt =
+
taskExecutorProcessSpecContainerResourcePriorityAdapter.getTaskExecutorProcessSpecAndResource(priority);
+
+ if (!taskExecutorProcessSpecAndResourceOpt.isPresent()) {
+ log.warn("Receive {} containers with unrecognized
priority {}. This should not happen.",
+ containers.size(), priority.getPriority());
+ for (Container container : containers) {
+ returnExcessContainer(container);
+ }
+ return;
+ }
Review comment:
Actually I don't see any possible reasons that
`taskExecutorProcessSpecAndResourceOpt` does not exist. This is just a safety
net. Maybe we can just replace this with `checkState`.
----------------------------------------------------------------
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:
[email protected]