Branch: refs/heads/step-in-groovy2
  Home:   https://github.com/jenkinsci/workflow-cps-plugin
  Commit: b6fd3093c0cfb962f6562ec30b51efa500c721f3
      
https://github.com/jenkinsci/workflow-cps-plugin/commit/b6fd3093c0cfb962f6562ec30b51efa500c721f3
  Author: Jesse Glick <jgl...@cloudbees.com>
  Date:   2016-09-17 (Sat, 17 Sep 2016)

  Changed paths:
    M 
src/main/resources/org/jenkinsci/plugins/workflow/cps/EnvActionImpl/Binder/help.jelly

  Log Message:
  -----------
  [JENKINS-33511] $WORKSPACE and $NODE_LABELS are now available.


  Commit: c10a8caa907e2452c83f2ef7fa54d81c6ac70654
      
https://github.com/jenkinsci/workflow-cps-plugin/commit/c10a8caa907e2452c83f2ef7fa54d81c6ac70654
  Author: Jesse Glick <jgl...@cloudbees.com>
  Date:   2016-09-19 (Mon, 19 Sep 2016)

  Changed paths:
    M 
src/main/resources/org/jenkinsci/plugins/workflow/cps/EnvActionImpl/Binder/help.jelly

  Log Message:
  -----------
  Merge pull request #61 from jglick/WORKSPACE-JENKINS-33511

[JENKINS-33511] Doc update


  Commit: a4aa9a8aecd122b00016078dc3b8102742bf828c
      
https://github.com/jenkinsci/workflow-cps-plugin/commit/a4aa9a8aecd122b00016078dc3b8102742bf828c
  Author: Kohsuke Kawaguchi <k...@kohsuke.org>
  Date:   2016-09-19 (Mon, 19 Sep 2016)

  Changed paths:
    M src/main/java/org/jenkinsci/plugins/workflow/cps/CpsVmExecutorService.java

  Log Message:
  -----------
  Cosmetic Java7 change


  Commit: 2323279aa7b60cae95cd47bf1fd52247fe138acb
      
https://github.com/jenkinsci/workflow-cps-plugin/commit/2323279aa7b60cae95cd47bf1fd52247fe138acb
  Author: Kohsuke Kawaguchi <k...@kohsuke.org>
  Date:   2016-09-19 (Mon, 19 Sep 2016)

  Changed paths:
    M src/main/java/org/jenkinsci/plugins/workflow/cps/CpsVmExecutorService.java

  Log Message:
  -----------
  Improve the error diagnostics.

I was looking at a problem where a test seemingly hangs forever. I tracked it 
down to a problem in CPS VM,
but what made this difficult for me is that a RuntimeException happening in 
some unexpected part of CPS VM went unreported.
If this error happened in the field, I would have never been able to figure 
this out. So I'm adding a diagnostics here to make sure
we can catch this class of problems.

Just for the record, the particular problem in CPS VM is a NullPointerException 
in the following place:

          at 
org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:283)
          at 
org.jenkinsci.plugins.workflow.cps.CpsBodyExecution.launch(CpsBodyExecution.java:161)
          at 
org.jenkinsci.plugins.workflow.cps.CpsBodyInvoker.launch(CpsBodyInvoker.java:189)
          at 
org.jenkinsci.plugins.workflow.cps.DSL$ThreadTaskImpl.invokeBody(DSL.java:501)
          at 
org.jenkinsci.plugins.workflow.cps.DSL$ThreadTaskImpl.eval(DSL.java:471)
          at 
org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:177)
          at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:324)
          at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:78)
          at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:236)
          at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:224)
          at 
org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
          at java.util.concurrent.FutureTask.run(FutureTask.java:166)
          at 
hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
          at 
jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
          at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
          at java.util.concurrent.FutureTask.run(FutureTask.java:166)
          at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:722)


  Commit: 0e2a049ce635a71a3b341ecf959350c628675ae9
      
https://github.com/jenkinsci/workflow-cps-plugin/commit/0e2a049ce635a71a3b341ecf959350c628675ae9
  Author: Kohsuke Kawaguchi <k...@kohsuke.org>
  Date:   2016-09-19 (Mon, 19 Sep 2016)

  Changed paths:
    A src/test/java/org/jenkinsci/plugins/workflow/cps/CpsBodyExecutionTest.java

  Log Message:
  -----------
  Test case that reproduces the problem


  Commit: ac9fe50fc2a26f697e49714c05254d50245fe99e
      
https://github.com/jenkinsci/workflow-cps-plugin/commit/ac9fe50fc2a26f697e49714c05254d50245fe99e
  Author: Kohsuke Kawaguchi <k...@kohsuke.org>
  Date:   2016-09-19 (Mon, 19 Sep 2016)

  Changed paths:
    M src/main/java/org/jenkinsci/plugins/workflow/cps/CpsBodyExecution.java
    M src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThread.java

  Log Message:
  -----------
  Fixing a bug in CPS VM about how it handles an exception in sync body.

See the previous commit for the test case that reproduces this problem.

Any exception aside from CpsCallableInvocation is a sign that the
execution has completed abnormally and synchronously. So this code pass
should have close parallel to the normal case that immediately follows
the 'params.body.getBody(currentThread).call()' invocation, yet the
thread association is missing from the failure case.

CpsBodyExecution.onSuccess/onFailure also assumes that they run in
CPS VM thread to be able to grow the flow node graph, as can be seen
in their use of CpsThread.current(). In the typical case where the body
being invoked is also CPS code, this assumption correctly holds as these
callbacks as invoked as Continuation while running CPS thread code, but
if it executes synchronously, this assumption does not hold, as the call
stack originates in `ThreadTask.eval(this)` that's outside the code
that sets the CpsThread.current() return value.

ThreadTask.eval() always operate in the context of single CpsThread,
it seems reasonable to run this code whiel CpsThread.current() is still
set.

(bug that motivated this change, from the parent of this commit)
------------------------------
When the body of a step is synchronous and explodes, the failure should
be recorded and the pipeline job should move on.

But instead, this hangs because CpsBodyExecution has a bug in how it
handles this case. It tries to launch the body (in this case the
'bodyBlock' method) in a separate CPS thread, and puts the parent CPS
thread on hold. Yet when the child CPS thread ends with an exception, it
fails to record this result correctly, and it gets into the eternal
sleep in which the parent CPS thread expects to be notified of the
outcome of the child CPS thread, which never arrives.


  Commit: 701f72334faa95fcac88c30447a67853e29263f0
      
https://github.com/jenkinsci/workflow-cps-plugin/commit/701f72334faa95fcac88c30447a67853e29263f0
  Author: Kohsuke Kawaguchi <k...@kohsuke.org>
  Date:   2016-09-19 (Mon, 19 Sep 2016)

  Changed paths:
    M src/test/java/org/jenkinsci/plugins/workflow/cps/CpsBodyExecutionTest.java
    A src/test/java/org/jenkinsci/plugins/workflow/cps/EmperorHasNoClothes.java

  Log Message:
  -----------
  Expanded the assertions

Test the shape of flow node graph and make sure the exception is
properly recorded.


  Commit: b17992d6db028528c63733935ce64171e48dc7c7
      
https://github.com/jenkinsci/workflow-cps-plugin/commit/b17992d6db028528c63733935ce64171e48dc7c7
  Author: Kohsuke Kawaguchi <k...@kohsuke.org>
  Date:   2016-09-20 (Tue, 20 Sep 2016)

  Changed paths:
    M src/main/java/org/jenkinsci/plugins/workflow/cps/CpsVmExecutorService.java

  Log Message:
  -----------
  Merge pull request #64 from jenkinsci/detect-failure-in-cps-vm

Detect failure in CPS VM


  Commit: acaf8d4472fe34dc74c6ed6f03dd0f4ffe65fb2e
      
https://github.com/jenkinsci/workflow-cps-plugin/commit/acaf8d4472fe34dc74c6ed6f03dd0f4ffe65fb2e
  Author: Kohsuke Kawaguchi <k...@kohsuke.org>
  Date:   2016-09-20 (Tue, 20 Sep 2016)

  Changed paths:
    M src/main/java/org/jenkinsci/plugins/workflow/cps/CpsBodyExecution.java
    M src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThread.java
    A src/test/java/org/jenkinsci/plugins/workflow/cps/CpsBodyExecutionTest.java
    A src/test/java/org/jenkinsci/plugins/workflow/cps/EmperorHasNoClothes.java

  Log Message:
  -----------
  Merge pull request #65 from jenkinsci/synchronous-abnormal-body-execution

Incorrect handling of synchronous abnormal termination of the body block


  Commit: ebc5e814e3df233dd8d5b400b8b645a407db924a
      
https://github.com/jenkinsci/workflow-cps-plugin/commit/ebc5e814e3df233dd8d5b400b8b645a407db924a
  Author: Kohsuke Kawaguchi <k...@kohsuke.org>
  Date:   2016-09-20 (Tue, 20 Sep 2016)

  Changed paths:
    M 
src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ingroovy/GroovyStepExecutionCompiler.java

  Log Message:
  -----------
  Removed a left over from the previous attempt


  Commit: 37c242c35ce05fef54a714146da7a52ea4149809
      
https://github.com/jenkinsci/workflow-cps-plugin/commit/37c242c35ce05fef54a714146da7a52ea4149809
  Author: Kohsuke Kawaguchi <k...@kohsuke.org>
  Date:   2016-09-20 (Tue, 20 Sep 2016)

  Changed paths:
    M src/main/java/org/jenkinsci/plugins/workflow/cps/CpsBodyExecution.java
    M src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThread.java
    M src/main/java/org/jenkinsci/plugins/workflow/cps/CpsVmExecutorService.java
    M 
src/main/resources/org/jenkinsci/plugins/workflow/cps/EnvActionImpl/Binder/help.jelly
    A src/test/java/org/jenkinsci/plugins/workflow/cps/CpsBodyExecutionTest.java
    A src/test/java/org/jenkinsci/plugins/workflow/cps/EmperorHasNoClothes.java

  Log Message:
  -----------
  Merge branch 'master' into step-in-groovy2


  Commit: 08351bc7ddc5b3035e8260b8baf47f1108baf9c7
      
https://github.com/jenkinsci/workflow-cps-plugin/commit/08351bc7ddc5b3035e8260b8baf47f1108baf9c7
  Author: Kohsuke Kawaguchi <k...@kohsuke.org>
  Date:   2016-09-20 (Tue, 20 Sep 2016)

  Changed paths:
    M doc/step-in-groovy.md

  Log Message:
  -----------
  Clarified that the return value is processed like you expect


Compare: 
https://github.com/jenkinsci/workflow-cps-plugin/compare/b92da13dfc3a...08351bc7ddc5

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to