[ https://issues.apache.org/jira/browse/FLINK-5488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16034117#comment-16034117 ]
ASF GitHub Bot commented on FLINK-5488: --------------------------------------- Github user zjureel commented on a diff in the pull request: https://github.com/apache/flink/pull/4022#discussion_r119779957 --- 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 -- It's a good point, I will put `getYarnClient()` in the `try` block > 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)