[ 
https://issues.apache.org/jira/browse/FLINK-4436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15432864#comment-15432864
 ] 

ASF GitHub Bot commented on FLINK-4436:
---------------------------------------

Github user tedyu commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2402#discussion_r75874655
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java ---
    @@ -164,6 +164,7 @@ public static void setTokensFor(ContainerLaunchContext 
amContainer, List<Path> p
     
                ByteBuffer securityTokens = ByteBuffer.wrap(dob.getData(), 0, 
dob.getLength());
                amContainer.setTokens(securityTokens);
    +           dob.close();
    --- End diff --
    
    Can you use try-with-resources here ?


> Unclosed DataOutputBuffer in Utils#setTokensFor()
> -------------------------------------------------
>
>                 Key: FLINK-4436
>                 URL: https://issues.apache.org/jira/browse/FLINK-4436
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Minor
>
> {code}
>     DataOutputBuffer dob = new DataOutputBuffer();
>     credentials.writeTokenStorageToStream(dob);
> {code}
> dob should be closed upon returning from the method.
> YarnApplicationMasterRunner#createTaskManagerContext() has similar issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to