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

hard killing a pipeline leaves the JVM CPS thread running.

    XMLWordPrintable

Details

    • Improvement
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • workflow-cps-plugin
    • None
    • pipeline 1.13
      jenkins 1.642.1

    Description

      In the event a pipeline build will not die you can hard kill it - however hard killing it will leave the JVMs CPS thread still running on the master.

      e.g. with the script

      def spin() {
          while (true) {}
      }
      
      def map = [:]
      map ["spin_it"] = { spin() } 
      }
      parallel map
      

      you will need to hard kill it to stop it (on windows at least) - but inspecting the JVM threads you can see the CPS thread is still running in a tight loop.
      A hard kill should probably (if it is safe without causing deadlocks elsewhere) brutally kill the thread as well. After a while you may run out of handles or other native resources due to the thread usage, meaning you need to restart Jenkins to get it working again.

      Attachments

        Issue Links

          Activity

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/support/concurrent/Timeout.java
            src/test/java/org/jenkinsci/plugins/workflow/support/concurrent/TimeoutTest.java
            http://jenkins-ci.org/commit/workflow-support-plugin/c810b3874134f60be670d1205b6673fde5003c14
            Log:
            JENKINS-32986 Introducing a general-purpose Timeout utility.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/support/concurrent/Timeout.java src/test/java/org/jenkinsci/plugins/workflow/support/concurrent/TimeoutTest.java http://jenkins-ci.org/commit/workflow-support-plugin/c810b3874134f60be670d1205b6673fde5003c14 Log: JENKINS-32986 Introducing a general-purpose Timeout utility.

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/support/concurrent/Timeout.java
            src/test/java/org/jenkinsci/plugins/workflow/support/concurrent/TimeoutTest.java
            http://jenkins-ci.org/commit/workflow-support-plugin/957d76a5538747f85db6f9ae33f076ee435f534b
            Log:
            Merge pull request #29 from jglick/Timeout-JENKINS-32986

            JENKINS-32986 Introducing a general-purpose Timeout utility

            Compare: https://github.com/jenkinsci/workflow-support-plugin/compare/eb031e04d6e3...957d76a55387

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/support/concurrent/Timeout.java src/test/java/org/jenkinsci/plugins/workflow/support/concurrent/TimeoutTest.java http://jenkins-ci.org/commit/workflow-support-plugin/957d76a5538747f85db6f9ae33f076ee435f534b Log: Merge pull request #29 from jglick/Timeout- JENKINS-32986 JENKINS-32986 Introducing a general-purpose Timeout utility Compare: https://github.com/jenkinsci/workflow-support-plugin/compare/eb031e04d6e3...957d76a55387

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/org/jenkinsci/plugins/workflow/cps/CpsBodyExecution.java
            src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThread.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/c0deed0a3b546ebcb59ea25681ed3ac8b13fe6bb
            Log:
            JENKINS-32986 Apply a timeout to some hang-prone operations in the CPS VM thread.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/cps/CpsBodyExecution.java src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThread.java http://jenkins-ci.org/commit/workflow-cps-plugin/c0deed0a3b546ebcb59ea25681ed3ac8b13fe6bb Log: JENKINS-32986 Apply a timeout to some hang-prone operations in the CPS VM thread.

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/org/jenkinsci/plugins/workflow/cps/CpsBodyExecution.java
            src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThread.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/51c02d40783bdc2be4e825d29c4c28286aa8c1dc
            Log:
            Merge pull request #102 from jglick/Timeout-JENKINS-32986

            JENKINS-32986 Apply a timeout to some hang-prone operations in the CPS VM thread

            Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/8da4ed31126f...51c02d40783b

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/cps/CpsBodyExecution.java src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThread.java http://jenkins-ci.org/commit/workflow-cps-plugin/51c02d40783bdc2be4e825d29c4c28286aa8c1dc Log: Merge pull request #102 from jglick/Timeout- JENKINS-32986 JENKINS-32986 Apply a timeout to some hang-prone operations in the CPS VM thread Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/8da4ed31126f...51c02d40783b
            jglick Jesse Glick added a comment -

            workflow-support PR 37 should fix the SerializableClassRegistry issue.

            jglick Jesse Glick added a comment - workflow-support PR 37 should fix the SerializableClassRegistry issue.

            People

              jglick Jesse Glick
              teilo James Nord
              Votes:
              4 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated: