[
https://issues.apache.org/jira/browse/FLINK-32509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Flink Jira Bot updated FLINK-32509:
-----------------------------------
Labels: auto-deprioritized-major pull-request-available (was:
pull-request-available stale-major)
Priority: Minor (was: Major)
This issue was labeled "stale-major" 7 days ago and has not received any
updates so it is being deprioritized. If this ticket is actually Major, please
raise the priority and ask a committer to assign you the issue or revive the
public discussion.
> 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: Minor
> Labels: auto-deprioritized-major, pull-request-available
>
> 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)