xintongsong commented on a change in pull request #13592:
URL: https://github.com/apache/flink/pull/13592#discussion_r505183845
##########
File path:
flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManagerDriver.java
##########
@@ -228,21 +221,27 @@ public void deregisterApplication(ApplicationStatus
finalStatus, @Nullable Strin
@Override
public CompletableFuture<YarnWorkerNode>
requestResource(TaskExecutorProcessSpec taskExecutorProcessSpec) {
- final Optional<Resource> containerResourceOptional =
getContainerResource(taskExecutorProcessSpec);
+ checkInitialized();
+
final CompletableFuture<YarnWorkerNode> requestResourceFuture =
new CompletableFuture<>();
- if (containerResourceOptional.isPresent()) {
-
resourceManagerClient.addContainerRequest(getContainerRequest(containerResourceOptional.get()));
+ final
Optional<TaskExecutorProcessSpecContainerResourcePriorityAdapter.PriorityAndResource>
priorityAndResourceOpt =
+
taskExecutorProcessSpecContainerResourcePriorityAdapter.getPriorityAndResource(taskExecutorProcessSpec);
+
+ if (!priorityAndResourceOpt.isPresent()) {
+ requestResourceFuture.completeExceptionally(
+ new
ResourceManagerException(String.format("Could not compute the container
Resource from the given TaskExecutorProcessSpec %s.",
taskExecutorProcessSpec)));
Review comment:
There should be other logs from
`taskExecutorProcessSpecContainerResourcePriorityAdapter` that gives the
reasons why resource cannot be computed. For the moment, the only possible
reason is that the requested resource is larger than the max container resource
Yarn allows. See
`TaskExecutorProcessSpecContainerResourcePriorityAdapter#tryAdaptResource` for
the logs.
----------------------------------------------------------------
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]