You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jun Rao (JIRA)" <ji...@apache.org> on 2012/07/22 22:47:36 UTC

[jira] [Commented] (KAFKA-407) Uncaught InputStream.close() exception in CompressionUtils.compress()

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

Jun Rao commented on KAFKA-407:
-------------------------------

In this case, we probably just want to throw the exception to the caller.
                
> Uncaught InputStream.close() exception in CompressionUtils.compress()
> ---------------------------------------------------------------------
>
>                 Key: KAFKA-407
>                 URL: https://issues.apache.org/jira/browse/KAFKA-407
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.7.1
>            Reporter: Lorenzo Alberton
>            Priority: Minor
>
> In CompressionUtils.compress(), in this try/catch block:
> ==========
> try {
>       cf.write(messageByteBuffer.array)
>     } catch {
>       case e: IOException => error("Error while writing to the GZIP output stream", e)
>       cf.close()
>       throw e
>     } finally {
>       cf.close()
>     }
> ==========
> cf.close() might throw an IOException, which is not handled.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira