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

          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.

          Not having durable tasks on Windows is a major blocker for me. Is there any update on this issue?

          Gabriel Loewen added a comment - Not having durable tasks on Windows is a major blocker for me. Is there any update on this issue?

          Carroll Chiou added a comment - - edited

          PR for isolated durable task in windows: https://github.com/jenkinsci/durable-task-plugin/pull/139

          Carroll Chiou added a comment - - edited PR for isolated durable task in windows: https://github.com/jenkinsci/durable-task-plugin/pull/139

          Carroll Chiou added a comment -

          PR has been merged. To enable the binary wrapper, set the following system properties:
          -Dorg.jenkinsci.plugins.durabletask.WindowsBatchScript.FORCE_BINARY_WRAPPER=true
          -Dorg.jenkinsci.plugins.durabletask.PowershellScript.FORCE_BINARY_WRAPPER=true

          Carroll Chiou added a comment - PR has been merged. To enable the binary wrapper, set the following system properties: -Dorg.jenkinsci.plugins.durabletask.WindowsBatchScript.FORCE_BINARY_WRAPPER=true -Dorg.jenkinsci.plugins.durabletask.PowershellScript.FORCE_BINARY_WRAPPER=true

          Allan BURDAJEWICZ added a comment - - edited

          carroll Actually the system properties are the following right ?

          -Dorg.jenkinsci.plugins.durabletask.WindowsBatchScript.USE_BINARY_WRAPPER=true
          -Dorg.jenkinsci.plugins.durabletask.PowershellScript.USE_BINARY_WRAPPER=true
          

          Allan BURDAJEWICZ added a comment - - edited carroll Actually the system properties are the following right ? -Dorg.jenkinsci.plugins.durabletask.WindowsBatchScript.USE_BINARY_WRAPPER= true -Dorg.jenkinsci.plugins.durabletask.PowershellScript.USE_BINARY_WRAPPER= true

          Carroll Chiou added a comment -

          Whoops! Yes, allan_burdajewicz, you are correct
          I've updated the release notes: https://github.com/jenkinsci/durable-task-plugin/releases/tag/durable-task-1.38

          Carroll Chiou added a comment - Whoops! Yes, allan_burdajewicz , you are correct I've updated the release notes: https://github.com/jenkinsci/durable-task-plugin/releases/tag/durable-task-1.38

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

              Created:
              Updated:
              Resolved: