spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Owen (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (SPARK-22058) the BufferedInputStream will not be closed if an exception occurs
Date Sun, 24 Sep 2017 08:40:00 GMT

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

Sean Owen reassigned SPARK-22058:
---------------------------------

    Assignee: zuotingbing

> 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
>            Assignee: 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message