GitHub user zuotingbing opened a pull request:
https://github.com/apache/spark/pull/19277
[SPARK-22058][COREthe BufferedInputStream will not be closed if an
exception occurs.
## What changes were proposed in this pull request?
EventLoggingListener use `val in = new BufferedInputStream(fs.open(log))`
and will close it if an exception occurs `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
}`
But, if `CompressionCodec.createCodec(new SparkConf, c)` throws an
exception, the BufferedInputStream `in` will not be closed anymore.
## How was this patch tested?
exist tests
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zuotingbing/spark SPARK-22058
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/19277.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #19277
----
commit ff4c4496a485c91f113ae8662a31261dd6f41987
Author: zuotingbing <[email protected]>
Date: 2017-09-19T11:23:49Z
[SPARK-22058][CORE]the BufferedInputStream will not be closed if an
exception occurs
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]