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

[BUILD_ID=dontKillMe] not work with PIPELINE BUILD's [sh] step

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Labels:
    • Environment:
      Jenkins Version: 2.32.3 / 2.60.1
      JAVA Version: 1.8.0_121
      TOMCAT Version(for jenkins): 9.0.0.M17
      SLAVE OS : Red Hat Enterprise Linux Server release 6.4 (Santiago)
    • Similar Issues:

      Description

      Google Group Post Link: https://groups.google.com/forum/#!topic/jenkinsci-dev/p3HzZkvLNFo

       

      summary:

      When jenkins builds finished, the background processes would be killed at the same time.

      I search the Internet, people say using "BUILD_ID=dontKillMe"(see -----JENKINS-14442-----) can slove the problem. but this feature only works on FREESTYLE BUILD . When I using  PIPELINE BUILD, that problem shows up again.

      For testing, I tried servial combinations and get following results.

      withenv:
      Jenkins Version: 2.32.3 /  2.60.1
      JAVA Version: 1.8.0_121
      TOMCAT Version(for jenkins): 9.0.0.M17
      SLAVE OS : Red Hat Enterprise Linux Server release 6.4 (Santiago) 
       
      test situations:

      1、JENKINS Master OS : CentOS6.8 / RedHat5.6 , Background processes can keep alive without setting "BUILD_ID=dontKillMe"。

      2、JENKINS Master OS : RedHat6.4  , using A FREESTYLE BUILD with "BUILD_ID=dontKillMe" , Background processes can keep alive

      3、⭐JENKINS Master OS : RedHat6.4  , using A PIPELINE BUILD with "BUILD_ID=dontKillMe" , Background processes always be killed

       

      guess:

      Due to backgroud processes can keep running on specific OS like CentOS6.8 / RedHat5.6 without using "BUILD_ID=dontKillMe" feature, and "BUILD_ID=dontKillMe" do works on FREESTYLE BUILD. 

      1、Backgroud processes being killed or not depends on Jenkins Master OS version? Is there any rules? 

      2、Maybe  pipeline's sh step not support "BUILD_ID=dontKillMe" feature? IF its ture , i hope this feature can be support in future. 

       

        Attachments

          Activity

          Hide
          o0tt0o Qin Ting added a comment -

          Just a pipeline attribute problem.

          SEE https://wiki.jenkins.io/display/JENKINS/ProcessTreeKiller

          "In case of Jenkins Pipeline use JENKINS_NODE_COOKIE instead of BUILD_ID" can solve this problem perfectly.

           

          Show
          o0tt0o Qin Ting added a comment - Just a pipeline attribute problem. SEE  https://wiki.jenkins.io/display/JENKINS/ProcessTreeKiller "In case of Jenkins Pipeline use  JENKINS_NODE_COOKIE  instead of  BUILD_ID " can solve this problem perfectly.  

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            o0tt0o Qin Ting
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: