mirror of https://github.com/sbt/sbt.git
Fix background job shutdown
When a user calls sbt exit and there is an active background job, sbt may not exit cleanly. This was primarily because the background job service shutdown method depended on the StandardMain.executionContext which was closed before the background job service was shutdown. This was fixable by reordering the resource closing in StandardMain.runManaged.
This commit is contained in:
parent
8d26bc73b4
commit
7426ae520c
|
|
@ -126,15 +126,14 @@ object StandardMain {
|
|||
def runManaged(s: State): xsbti.MainResult = {
|
||||
val previous = TrapExit.installManager()
|
||||
try {
|
||||
val hook = ShutdownHooks.add(closeRunnable)
|
||||
try {
|
||||
val hook = ShutdownHooks.add(closeRunnable)
|
||||
try {
|
||||
MainLoop.runLogged(s)
|
||||
} finally {
|
||||
hook.close()
|
||||
()
|
||||
}
|
||||
} finally DefaultBackgroundJobService.backgroundJobService.shutdown()
|
||||
MainLoop.runLogged(s)
|
||||
} finally {
|
||||
try DefaultBackgroundJobService.backgroundJobService.shutdown()
|
||||
finally hook.close()
|
||||
()
|
||||
}
|
||||
} finally TrapExit.uninstallManager(previous)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue