Skip to content

Commit 09f4db2

Browse files
committed
[compile server] Register shutdown tasks on a background thread, not immediately during class initialization #SCL-23712 fixed
- That way we don't also initialize services during class initialization.
1 parent 5f574a6 commit 09f4db2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: scala/compiler-integration/src/org/jetbrains/plugins/scala/compiler/CompileServerLauncher.scala

+6-4
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ object CompileServerLauncher {
7777
}
7878
}
7979

80-
ScalaShutDownTracker.registerShutdownTask(() => {
81-
LOG.info("Shutdown event triggered, stopping server")
82-
stopServerAndWaitFor(Duration.Zero)
83-
})
80+
executeOnPooledThread {
81+
ScalaShutDownTracker.registerShutdownTask(() => {
82+
LOG.info("Shutdown event triggered, stopping server")
83+
stopServerAndWaitFor(Duration.Zero)
84+
})
85+
}
8486

8587
private def isUnitTestMode: Boolean =
8688
ApplicationManager.getApplication.isUnitTestMode

0 commit comments

Comments
 (0)