Skip to content

Commit

Permalink
Fix async job thread pool memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
allwefantasy committed Apr 30, 2020
1 parent a5af69f commit 5517cd5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## MLSQL

MLSQL is a Programming Language Designed For Big Data and AI, and it also have a distributed runtime.
MLSQL is a Programming Language Designed For Big Data and AI, and it also have a distributed runtime.

![](http://docs.mlsql.tech/upload_images/WechatIMG67.png)

## Official WebSite

Expand Down
11 changes: 10 additions & 1 deletion streamingpro-core/src/main/java/tech/mlsql/job/JobManager.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,16 @@ object JobManager extends Logging {
_executor.execute(new Runnable {
override def run(): Unit = {
ScriptSQLExec.setContext(context)
JobManager.run(session, job, f)
try {
JobManager.run(session, job, f)
} catch {
case e: Exception =>
logInfo("Async Job Exception", e)
} finally {
ScriptSQLExec.unset
SparkSession.clearActiveSession()
}

}
})
}
Expand Down

0 comments on commit 5517cd5

Please sign in to comment.