Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-27617

Isolate durable task in a dedicated Windows process group

    • 1.38

      Durable task is launched in the process tree of slave.jar process.

      When slave agent exits, it doesn't kill durable tasks (ProcessTree utility excludes the detached build). But when the slave is managed as a Windows service, the service wrapper kills all processes of the process tree and consequently stops durable tasks.

      Durable task should be launched in a dedicated process group isolated from slave.jar process tree.

          [JENKINS-27617] Isolate durable task in a dedicated Windows process group

          Yoann Dubreuil created issue -
          Yoann Dubreuil made changes -
          Description Original: Durable task is launched in the process tree of slave.jar process.

          When slave agent exits, it doesn't kill durable tasks (```ProcessTree``` utility excludes the detached build). But when the slave is managed as a Windows service, the service wrapper kills all processes of the process tree and consequently stops durable tasks.

          Durable task should be launched in a dedicated process group isolated from slave.jar process tree.
          New: Durable task is launched in the process tree of slave.jar process.

          When slave agent exits, it doesn't kill durable tasks ({{ProcessTree}} utility excludes the detached build). But when the slave is managed as a Windows service, the service wrapper kills all processes of the process tree and consequently stops durable tasks.

          Durable task should be launched in a dedicated process group isolated from slave.jar process tree.
          Yoann Dubreuil made changes -
          Link New: This issue is related to JENKINS-25503 [ JENKINS-25503 ]
          Yoann Dubreuil made changes -
          Summary Original: Isolate long running task in a dedicated process group New: Isolate durable task in a dedicated process group
          Jesse Glick made changes -
          Assignee Original: Jesse Glick [ jglick ]

          Jesse Glick added a comment -

          wmic process call create looks promising, if it can be made to pass Create_New_Process_Group.

          Jesse Glick added a comment - wmic process call create looks promising, if it can be made to pass Create_New_Process_Group .

          Jesse Glick added a comment -

          Also considering using Golang, or using jna-platform.

          Jesse Glick added a comment - Also considering using Golang, or using jna-platform .

          Jesse Glick added a comment -

          By depending on net.java.dev.jna:jna-platform:4.1.0 we could call Kernel32.INSTANCE.CreateProcess with WinBase.CREATE_NEW_PROCESS_GROUP. Would it help?

          Jesse Glick added a comment - By depending on net.java.dev.jna:jna-platform:4.1.0 we could call Kernel32.INSTANCE.CreateProcess with WinBase.CREATE_NEW_PROCESS_GROUP . Would it help?

          This stackoverflow http://stackoverflow.com/questions/5177140/creating-independent-process suggests that it should help. But it says that an intermediate process needs to be created to properly escape the supervision of the root process.

          Yoann Dubreuil added a comment - This stackoverflow http://stackoverflow.com/questions/5177140/creating-independent-process suggests that it should help. But it says that an intermediate process needs to be created to properly escape the supervision of the root process.
          Jesse Glick made changes -
          Epic Link New: JENKINS-35399 [ 171192 ]

            carroll Carroll Chiou
            ydubreuil Yoann Dubreuil
            Votes:
            8 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: