Jackeyzhe opened a new pull request, #29246:
URL: https://github.com/apache/flink/pull/29246

   ## What is the purpose of the change
   
   This pull request addresses
   [FLINK-32509](https://issues.apache.org/jira/browse/FLINK-32509).
   
   `InputStreamFSInputWrapper.seek(long)` currently relies on
   `InputStream.skip(long)` to move forward. The `InputStream` contract allows
   `skip()` to return zero, including at EOF, so seeking beyond the stream can
   loop forever. Some implementations can also report a positive skip beyond the
   actual EOF, allowing the wrapper to accept an unreachable position.
   
   This change makes forward seek consume bytes through a bounded buffer and
   throw `EOFException` when the requested position cannot be reached.
   
   ## Brief change log
   
   - Replace `InputStream.skip()` in forward seek with bounded read-and-discard
     operations.
   - Keep the wrapper position aligned with bytes actually consumed.
   - Add regression coverage for zero-progress EOF, false skip progress beyond
     EOF, and successful forward seek across the buffer boundary.
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - `InputStreamFSInputWrapperTest` covers normal forward seek, zero-progress 
EOF,
     and a stream that reports skip progress beyond its real end.
   - `FileInputFormatTest` covers the closest existing caller behavior.
   - `./mvnw -pl flink-core -am -DskipITs 
-Dtest=InputStreamFSInputWrapperTest,FileInputFormatTest 
-Dsurefire.failIfNoSpecifiedTests=false test`
     passes 36 tests with no failures, errors, or skips.
   
   ## Does this pull request potentially affect one of the following parts:
   
   - Dependencies (does it add or upgrade a dependency): **no**
   - The public API, i.e., is any changed class annotated with
     `@Public(Evolving)`: **no**
   - The serializers: **no**
   - The runtime per-record code paths (performance sensitive): **no**
   - Anything that affects deployment or recovery: JobManager (and its
     components), Checkpointing, Kubernetes/Yarn, ZooKeeper: **no**
   - The S3 file system connector: **no**
   
   ## Documentation
   
   - Does this pull request introduce a new feature? **no**
   - If yes, how is the feature documented? **not applicable**
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [] Yes (please specify the tool below)
   
   Generated-by: 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to