commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Shattu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (COMPRESS-384) Tar File EOF not being detected
Date Sat, 22 Apr 2017 15:31:04 GMT

     [ https://issues.apache.org/jira/browse/COMPRESS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jason Shattu updated COMPRESS-384:
----------------------------------

Well to be precise the FilterInputStream, reads the underlying input, if it
is -1 then it sleeps the thread for a small period and then tries again. If
it has some data it returns back to requesting the Input Stream.   It
repeats this indefinitely. Although I can configure it to timeout.

If i sleep the thread then naturally the compression is blocked at the same
time.

This is all to do with having flexibility to deal with very slow realtime
archive producers.

Admittedly this is an advanced use case,but given the nature of streams I
think it should support this. It looks like the TAR format isn't dealing
with EOF in quite the same way as ZIP.

Jason


On 22 Apr 2017 15:55, "Stefan Bodewig (JIRA)" <jira@apache.org> wrote:


    [ https://issues.apache.org/jira/browse/COMPRESS-384?page=
com.atlassian.jira.plugin.system.issuetabpanels:comment-
tabpanel&focusedCommentId=15979965#comment-15979965 ]

Stefan Bodewig commented on COMPRESS-384:
-----------------------------------------

Maybe I'm starting to understand.

So your FilterInputStream blocks on read if the underlying stream doesn't
provide any data right now. What are you expecting the underlying stream to
do, i.e. when are you blocking and when do you assume the stream has been
exhausted and return -1 from read in the implementation of your own?


latest version of 7zip. When I read both archives using code of the form:
Input doesn't return a "null" entry when it hits the EOF from
archiveStream.getNextEntry()
is still being written to.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


> Tar File EOF not being detected
> -------------------------------
>
>                 Key: COMPRESS-384
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-384
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 1.13
>         Environment: Windows 10, JDK 1.8
>            Reporter: Jason Shattu
>         Attachments: file.tar
>
>
> I've created both a zip and tar file, with the same contents using the latest version
of 7zip. When I read both archives using code of the form:
> ArchiveStreamFactory().createArchiveInputStream(format, inputStream);
> I notice that both formats correctly list their contents, however the Tar Input doesn't
return a "null" entry when it hits the EOF from archiveStream.getNextEntry() 
> this makes it hard to distinguish between a genuine EOF or a file which is still being
written to. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message