You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2017/09/19 11:30:00 UTC

[jira] [Commented] (SPARK-22058) the BufferedInputStream will not be closed if an exception occurs

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

Apache Spark commented on SPARK-22058:
--------------------------------------

User 'zuotingbing' has created a pull request for this issue:
https://github.com/apache/spark/pull/19277

> the BufferedInputStream will not be closed if an exception occurs
> -----------------------------------------------------------------
>
>                 Key: SPARK-22058
>                 URL: https://issues.apache.org/jira/browse/SPARK-22058
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 2.2.0
>            Reporter: zuotingbing
>            Priority: Minor
>
> EventLoggingListener use 
> {code:java}
>  val in = new BufferedInputStream(fs.open(log))
> {code} 
> and will close it if an exception occurs
> {code:java}
> val codec = codecName.map { c =>
>       codecMap.getOrElseUpdate(c, CompressionCodec.createCodec(new SparkConf, c))
>     }
> try {
>       codec.map(_.compressedInputStream(in)).getOrElse(in)
>     } catch {
>       case e: Exception =>
>         in.close()
>         throw e
>     }
> {code}
> But, if 
> {code:java}
> CompressionCodec.createCodec(new SparkConf, c)
> {code} throws an exception, the BufferedInputStream
> {code:java}
> in
> {code} will not be closed anymore.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org