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

NPE from CpsStepContext.scheduleNextRun



    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • workflow-cps-plugin
    • None
    • Jenkins 2.53
      workflow-cps 2.29


      After a timeout occurence, my pipeline wil leventually end with a message

      Body did not finish within grace period; terminating with extreme prejudice"

       Later on, build failure analyzer and lockable-resources do their work (analyzing and unlicking), github-branch-source signals the run result to github and and exception is printed:

      	at org.jenkinsci.plugins.workflow.cps.CpsStepContext.scheduleNextRun(CpsStepContext.java:386)
      	at org.jenkinsci.plugins.workflow.cps.CpsStepContext.completed(CpsStepContext.java:339)
      	at org.jenkinsci.plugins.workflow.cps.CpsStepContext.onFailure(CpsStepContext.java:328)
      	at org.jenkinsci.plugins.workflow.cps.CpsBodySubContext.onFailure(CpsBodySubContext.java:63)
      	at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onFailure(BodyExecutionCallback.java:128)
      	at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:345)
      	at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:68)
      	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
      	at com.cloudbees.groovy.cps.Next.step(Next.java:74)
      Finished: FAILURE

      The run will stop showing at the build queue (is not using a lightweight nor a normal executor), but after a Jenkins restart, it will appear again, queued waiting for an agent:

      Resuming build at Wed Apr 05 09:34:49 CEST 2017 after Jenkins restart
      Waiting to resume part of Crossdata » crossdata-spark2 » PR-5 #2: ???
      Waiting to resume part of Crossdata » crossdata-spark2 » PR-5 #2: There are no nodes with the label ...

      This might show that a CPSThread isnt completelly killed, and seems to be related to myself capturing the timeout exception, handling it and rethrowing. With the NPE, the execution flow hungs forever, leading to resources extarvation.


        Issue Links


            witokondoria Javier Delgado created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Component/s pipeline [ 21692 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 119 (Web Link)" [ 16108 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            jglick Jesse Glick made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]


              jglick Jesse Glick
              witokondoria Javier Delgado
              1 Vote for this issue
              4 Start watching this issue