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

Stopping a parent job doesn't stop the triggered child jobs

      Assume you have a job A that launch a child Job B and that job A has to wait Job B finished to continue its steps.

      If you stopped job A while job B is processing, the job B isn't stopped.
      It should be stopped.

      Precondition:
      I have a parent job "Parent" that triggers child jobs "Child(1-N)", and then blocks waiting for them to finish.

      Action:
      1. Start Parent job.
      2. Wait for children to launch.
      3. Abort Parent job.

      Current result: 
      Parent job aborts but children continue to run. If the child jobs have no meaning outside of the parent, then child jobs have to be manually aborted.

      I can see why you would want this behavior. It is certainly the correct behavior in the "post-build step" case. It is probably correct in the "non-blocking build step" case. In the case of the parent build blocking on children completing, there are definitely scenarios where it is not.

      Desired Enhancement:
      When "Block on child job completion" checkbox is checked, a list of options is shown. Add option to the list: "Child job action when parent job is aborted". Values: "None, continue running (default)", "Abort immediately".

          [JENKINS-11257] Stopping a parent job doesn't stop the triggered child jobs

          Nicolas Godelu created issue -
          Jonathan Gonzalez made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Nicolas Godelu made changes -
          Summary Original: Stopping a prent job doesn't stop the trgiggered child jobs New: Stopping a parent job doesn't stop the triggered child jobs
          Nickolay Rumyantsev made changes -
          Link New: This issue is duplicated by JENKINS-20273 [ JENKINS-20273 ]
          ikedam made changes -
          Issue Type Original: Bug [ 1 ] New: Improvement [ 4 ]
          Priority Original: Critical [ 2 ] New: Major [ 3 ]
          Sebastian Schuberth made changes -
          Link Original: This issue is duplicated by JENKINS-20273 [ JENKINS-20273 ]
          Anish Dangi made changes -
          Comment [ We needed this feature as we trigger and abort jobs from the command line, which makes it easy to abort. The zombie child jobs would tie up our build machines. I added this functionality to the plugin: Here is the relevant commit https://github.com/ad22/parameterized-trigger-plugin/commit/30ec9844e026c4a95eb3663e8c4c9d4a3d74fd01 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 141476 ] New: JNJira + In-Review [ 185388 ]
          Liam Newman made changes -
          Description Original: Assume you have a job A that launch a child Job B and that job A has to wait Job B finished to continue its steps.

          If you stopped job A while job B is processing, the job B isn't stopped.
          It should be stopped.


          New: Assume you have a job A that launch a child Job B and that job A has to wait Job B finished to continue its steps.

          If you stopped job A while job B is processing, the job B isn't stopped.
           It should be stopped.

          Precondition:
          I have a parent job "Parent" that triggers child jobs "Child(1-N)", and then blocks waiting for them to finish.

          Action:
          1. Start Parent job.
          2. Wait for children to launch.
          3. Abort Parent job.

          Current result: 
          Parent job aborts but children continue to run. If the child jobs have no meaning outside of the parent, then child jobs have to be manually aborted.

          I can see why you would want this behavior. It is certainly the correct behavior in the "post-build step" case. It is probably correct in the "non-blocking build step" case. In the case of the parent build blocking on children completing, there are definitely scenarios where it is not.

          Desired Enhancement:
          When "Block on child job completion" checkbox is checked, a list of options is shown. Add option to the list: "Child job action when parent job is aborted". Values: "None, continue running (default)", "Abort immediately".
          Liam Newman made changes -
          Link New: This issue is duplicated by JENKINS-27740 [ JENKINS-27740 ]

            huybrechts huybrechts
            nicolas_godelu Nicolas Godelu
            Votes:
            31 Vote for this issue
            Watchers:
            33 Start watching this issue

              Created:
              Updated: