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

Sean Owen resolved SPARK-22058.
-------------------------------
       Resolution: Fixed
    Fix Version/s: 2.3.0

Issue resolved by pull request 19277
[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: Trivial
>             Fix For: 2.3.0
>
>
> 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-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to