Skip to content

Commit

Permalink
Explicitly stop sparkSession on exception (#65)
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>
  • Loading branch information
pyalex committed Apr 28, 2021
1 parent aa68e32 commit 3929cbd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ object IngestionJob {
sparkSession.close()
case Modes.Online =>
val sparkSession = BasePipeline.createSparkSession(config)
StreamingPipeline.createPipeline(sparkSession, config).get.awaitTermination
try {
StreamingPipeline.createPipeline(sparkSession, config).get.awaitTermination
} finally {
sparkSession.close()
}
}
case None =>
println("Parameters can't be parsed")
Expand Down

0 comments on commit 3929cbd

Please sign in to comment.