[
https://issues.apache.org/jira/browse/FLINK-9580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16513952#comment-16513952
]
ASF GitHub Bot commented on FLINK-9580:
---------------------------------------
Github user pnowojski commented on a diff in the pull request:
https://github.com/apache/flink/pull/6166#discussion_r195774052
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestClient.java ---
@@ -292,30 +292,49 @@ private void readRawResponse(FullHttpResponse msg) {
ByteBuf content = msg.content();
JsonNode rawResponse;
+ InputStream in = null;
try {
- InputStream in = new
ByteBufInputStream(content);
+ in = new ByteBufInputStream(content);
--- End diff --
couldn't you put this `InputStream` inside try with resource?
```
try (InputStream in = new ByteBufInputStream(content)) {
...
}
```
> Potentially unclosed ByteBufInputStream in RestClient#readRawResponse
> ---------------------------------------------------------------------
>
> Key: FLINK-9580
> URL: https://issues.apache.org/jira/browse/FLINK-9580
> Project: Flink
> Issue Type: Bug
> Reporter: Ted Yu
> Assignee: vinoyang
> Priority: Minor
>
> Here is related code:
> {code}
> ByteBufInputStream in = new ByteBufInputStream(content);
> byte[] data = new byte[in.available()];
> in.readFully(data);
> {code}
> In the catch block, ByteBufInputStream is not closed.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)