[
https://issues.apache.org/jira/browse/FLINK-32509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Flink Jira Bot updated FLINK-32509:
-----------------------------------
Labels: pull-request-available stale-major (was: pull-request-available)
I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help
the community manage its development. I see this issues has been marked as
Major but is unassigned and neither itself nor its Sub-Tasks have been updated
for 60 days. I have gone ahead and added a "stale-major" to the issue". If this
ticket is a Major, please either assign yourself or give an update. Afterwards,
please remove the label or in 7 days the issue will be deprioritized.
> avoid using skip in InputStreamFSInputWrapper.seek
> --------------------------------------------------
>
> Key: FLINK-32509
> URL: https://issues.apache.org/jira/browse/FLINK-32509
> Project: Flink
> Issue Type: Bug
> Components: API / Core
> Affects Versions: 1.18.0
> Reporter: Libin Qin
> Priority: Major
> Labels: pull-request-available, stale-major
>
> The implementation of InputStream does not return -1 for eof.
> The java doc of InputStream said "The skip method may, for a variety of
> reasons, end up skipping over some smaller number of bytes, possibly 0."
> For FileInputStream, it allows skipping any number of bytes past the end of
> the file.
> So the method "seek" of InputStreamFSInputWrapper will cause infinite loop if
> desired exceed end of file
>
> I reproduced with following case
>
> {code:java}
> byte[] bytes = "flink".getBytes();
> try (InputStream inputStream = new ByteArrayInputStream(bytes)){
> InputStreamFSInputWrapper wrapper = new
> InputStreamFSInputWrapper(inputStream);
> wrapper.seek(20);
> } {code}
> I found an issue of commons-io talks about the problem of skip
> https://issues.apache.org/jira/browse/IO-203
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)