[
https://issues.apache.org/jira/browse/MAPREDUCE-7494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17889866#comment-17889866
]
ASF GitHub Bot commented on MAPREDUCE-7494:
-------------------------------------------
davintjong-db opened a new pull request, #7117:
URL: https://github.com/apache/hadoop/pull/7117
<!--
Thanks for sending a pull request!
1. If this is your first time, please read our contributor guidelines:
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
2. Make sure your PR title starts with JIRA issue id, e.g.,
'HADOOP-17799. Your PR title ...'.
-->
### Description of PR
In LineRecordReader, we may open a filestream:
```
fileIn = FutureIO.awaitFuture(builder.build());
```
However, we may be interrupted or otherwise throw an error before `in` is
initialized, for example here:
```
fileIn.seek(start);
```
If this happens, the caller has no way to close this file stream causing it
to leak.
### How was this patch tested?
Existing tests.
### For code changes:
- [ ] Does the title or this PR starts with the corresponding JIRA issue id
(e.g. 'HADOOP-17799. Your PR title ...')?
- [ ] Object storage: have the integration tests been executed and the
endpoint declared according to the connector-specific documentation?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`,
`NOTICE-binary` files?
> Fix potential file stream leaks caused by interruption
> ------------------------------------------------------
>
> Key: MAPREDUCE-7494
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-7494
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Reporter: Davin Tjong
> Priority: Major
>
> In LineRecordReader, we may open a filestream:
> ```
> fileIn = FutureIO.awaitFuture(builder.build());
> ```
> However, we may be interrupted or otherwise throw an error before `in` is
> initialized, for example here:
> ```
> fileIn.seek(start);
> ```
> If this happens, the caller has no way to close this file stream causing it
> to leak.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]