Skip to content

[Bug] skipFully spins forever on a zero-byte skip at end of stream #9778

Description

@LuciferYang

Bug description

HadoopSeekableInputStream.skipFully (and its copies in every HadoopCompliantFileIO wrapper: azure, cosn, gs, jindo, obs, oss, s3) loops with

while (bytes > 0) { bytes -= in.skip(bytes); }

A blocking stream at end of file returns 0 from skip, so a small forward seek — the vectored-read seek helper skips gaps of up to 1 MiB instead of seeking — past a truncated or shorter-than-expected file spins the loop forever instead of failing the read.

Expected behavior

Throw EOFException when a skip call makes no progress, like Hadoop's own IOUtils.skipFully treats premature EOF.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions