[ https://issues.apache.org/jira/browse/FLINK-5488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16053877#comment-16053877 ]
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_r122688150 --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java --- @@ -420,6 +421,9 @@ public YarnClusterClient retrieve(String applicationID) { return createYarnClusterClient(this, yarnClient, appReport, flinkConfiguration, false); } catch (Exception e) { + if(null != yarnClient) { --- End diff -- missing space after if. > 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.4.14#64029)