Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5739#discussion_r29269314
--- Diff:
core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala
---
@@ -224,9 +224,9 @@ class FsHistoryProviderSuite extends FunSuite with
BeforeAndAfter with Matchers
EventLoggingListener.initEventLog(new FileOutputStream(file))
}
val writer = new OutputStreamWriter(bstream, "UTF-8")
- try {
+ Utils.tryWithSafeFinally {
events.foreach(e =>
writer.write(compact(render(JsonProtocol.sparkEventToJson(e))) + "\n"))
- } finally {
+ } {
--- End diff --
Not your fault, but this looks super ugly. I'd favor using something like
the following instead of that `Utils` method:
try {
// code
} finally Utils.catchAndLogExceptions {
// finally block that may throw
}
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]