Skip to content

Commit

Permalink
JS-2148 Don't kill -STOP under Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Zschimmer committed Aug 31, 2024
1 parent 0a15879 commit 1c1aa3f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import js7.base.io.process.Processes.*
import js7.base.io.process.{JavaProcess, Js7Process, Pid, ReturnCode}
import js7.base.log.Logger
import js7.base.log.Logger.syntax.*
import js7.base.system.OperatingSystem.isUnix
import js7.base.thread.IOExecutor.env.interruptibleVirtualThread
import js7.base.time.ScalaTime.*
import js7.base.utils.Assertions.assertThat
Expand Down Expand Up @@ -130,8 +131,9 @@ private[launcher] trait ProcessKiller[P <: Pid | Js7Process]:
(isAlive(process) ? process.toPid.number) ++: descendants.map(_.pid)

// Try to stop all processes, then kill them
trySendStopSignal(stopPids) *>
sigkillAll(processToDescendants)
IO.whenA(isUnix):
trySendStopSignal(stopPids)
*> sigkillAll(processToDescendants)

/** Return a Seq of distinct ProcessHandles */
private def descendantsOf(processHandles: Seq[ProcessHandle]): Seq[ProcessHandle] =
Expand Down

0 comments on commit 1c1aa3f

Please sign in to comment.