[jira] [Created] (COMPRESS-127) Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (COMPRESS-127) Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream

Gilles Sadowski (Jira)
Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream
-------------------------------------------------------------------------------------------------------------------------------------------

                 Key: COMPRESS-127
                 URL: https://issues.apache.org/jira/browse/COMPRESS-127
             Project: Commons Compress
          Issue Type: Bug
          Components: Compressors
            Reporter: Doron Cohen


When creating and closing a stream like this:

{code}
InputStream is = csFactory.createCompressorInputStream(CompressorStreamFactory.GZIP, in);
is.close();
{code}

The underlying stream *in* is not closed.

It seems like  a bug - for instance it prevents from deleting the file on which that stream was opened.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (COMPRESS-127) Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream

Gilles Sadowski (Jira)

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

Doron Cohen updated COMPRESS-127:
---------------------------------

    Attachment: CreateCompressorInputStreamTest.java

Attached simple program creates the bug.
As written the program fails.
Uncomment line 39 and it should pass.

{code}
// uncomment the following line to make the test pass
// but I think it should have passed without this line and this is actually a bug
//bis.close();
{code}

> Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-127
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-127
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>            Reporter: Doron Cohen
>         Attachments: CreateCompressorInputStreamTest.java
>
>
> When creating and closing a stream like this:
> {code}
> InputStream is = csFactory.createCompressorInputStream(CompressorStreamFactory.GZIP, in);
> is.close();
> {code}
> The underlying stream *in* is not closed.
> It seems like  a bug - for instance it prevents from deleting the file on which that stream was opened.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (COMPRESS-127) Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream

Gilles Sadowski (Jira)
In reply to this post by Gilles Sadowski (Jira)

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

Doron Cohen commented on COMPRESS-127:
--------------------------------------

The attached test will fail in Windows but might pass in Linux.
Still the problem is real.
It is not too difficult to write a test that will fail also in Linux - see [Shai's suggestion in LUCENE-2980|https://issues.apache.org/jira/browse/LUCENE-2980?focusedCommentId=13009986&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13009986].

> Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-127
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-127
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>            Reporter: Doron Cohen
>         Attachments: CreateCompressorInputStreamTest.java
>
>
> When creating and closing a stream like this:
> {code}
> InputStream is = csFactory.createCompressorInputStream(CompressorStreamFactory.GZIP, in);
> is.close();
> {code}
> The underlying stream *in* is not closed.
> It seems like  a bug - for instance it prevents from deleting the file on which that stream was opened.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (COMPRESS-127) Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream

Gilles Sadowski (Jira)
In reply to this post by Gilles Sadowski (Jira)

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

Sebb commented on COMPRESS-127:
-------------------------------

It does seem to be an omission, because the BZip2 version closes the wrapped stream, as do the ArchiveInputStream sub-classes that I checked..

> Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-127
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-127
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>            Reporter: Doron Cohen
>         Attachments: CreateCompressorInputStreamTest.java
>
>
> When creating and closing a stream like this:
> {code}
> InputStream is = csFactory.createCompressorInputStream(CompressorStreamFactory.GZIP, in);
> is.close();
> {code}
> The underlying stream *in* is not closed.
> It seems like  a bug - for instance it prevents from deleting the file on which that stream was opened.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (COMPRESS-127) Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream

Gilles Sadowski (Jira)
In reply to this post by Gilles Sadowski (Jira)

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

Doron Cohen commented on COMPRESS-127:
--------------------------------------

hi Sebb, thanks for looking into this!

bq. because the BZip2 version closes the wrapped stream,

I verified this in LUCENE-2980 where I put a workaround for this - indeed, it is not needed for BZip2, only for GZIP.

> Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-127
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-127
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>            Reporter: Doron Cohen
>         Attachments: CreateCompressorInputStreamTest.java
>
>
> When creating and closing a stream like this:
> {code}
> InputStream is = csFactory.createCompressorInputStream(CompressorStreamFactory.GZIP, in);
> is.close();
> {code}
> The underlying stream *in* is not closed.
> It seems like  a bug - for instance it prevents from deleting the file on which that stream was opened.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (COMPRESS-127) Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream

Gilles Sadowski (Jira)
In reply to this post by Gilles Sadowski (Jira)

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

Sebb resolved COMPRESS-127.
---------------------------

       Resolution: Fixed
    Fix Version/s: 1.2

Fixed by adding close() method to GZipCompressorInputStream

> Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-127
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-127
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>            Reporter: Doron Cohen
>             Fix For: 1.2
>
>         Attachments: CreateCompressorInputStreamTest.java
>
>
> When creating and closing a stream like this:
> {code}
> InputStream is = csFactory.createCompressorInputStream(CompressorStreamFactory.GZIP, in);
> is.close();
> {code}
> The underlying stream *in* is not closed.
> It seems like  a bug - for instance it prevents from deleting the file on which that stream was opened.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (COMPRESS-127) Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream

Gilles Sadowski (Jira)
In reply to this post by Gilles Sadowski (Jira)

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

Doron Cohen commented on COMPRESS-127:
--------------------------------------

Thanks!

> Calling close() on inputStream returned by CompressorStreamFactory.createCompressorInputStream() does not close the underlying input stream
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-127
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-127
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>            Reporter: Doron Cohen
>             Fix For: 1.2
>
>         Attachments: CreateCompressorInputStreamTest.java
>
>
> When creating and closing a stream like this:
> {code}
> InputStream is = csFactory.createCompressorInputStream(CompressorStreamFactory.GZIP, in);
> is.close();
> {code}
> The underlying stream *in* is not closed.
> It seems like  a bug - for instance it prevents from deleting the file on which that stream was opened.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira