[
https://issues.apache.org/jira/browse/FLINK-5488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16031769#comment-16031769
]
ASF GitHub Bot commented on FLINK-5488:
---------------------------------------
Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/4022#discussion_r119448300
--- Diff:
flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java
---
@@ -392,6 +392,7 @@ protected YarnClient getYarnClient() {
@Override
public YarnClusterClient retrieve(String applicationID) {
+ final YarnClient yarnClient = getYarnClient();
try {
// check if required Hadoop environment variables are
set. If not, warn user
if (System.getenv("HADOOP_CONF_DIR") == null &&
--- End diff --
does `getYarnClient()` fail if this condition is fulfilled? If so we should
put this if block before the call to `getYarnClient()`.
> yarnClient should be closed in AbstractYarnClusterDescriptor for error
> conditions
> ---------------------------------------------------------------------------------
>
> Key: FLINK-5488
> URL: https://issues.apache.org/jira/browse/FLINK-5488
> Project: Flink
> Issue Type: Bug
> Components: YARN
> Reporter: Ted Yu
> Assignee: Fang Yong
>
> Here is one example:
> {code}
> if(jobManagerMemoryMb > maxRes.getMemory() ) {
> failSessionDuringDeployment(yarnClient, yarnApplication);
> throw new YarnDeploymentException("The cluster does not have the
> requested resources for the JobManager available!\n"
> + "Maximum Memory: " + maxRes.getMemory() + "MB Requested: " +
> jobManagerMemoryMb + "MB. " + NOTE);
> }
> {code}
> yarnClient implements Closeable.
> It should be closed in situations where exception is thrown.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)