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

WorkflowRun assigned FlowExecution when execution start fails

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline
    • None

      WorkflowRun initialises its "execution" property before the execution is started. If the start fails, the Run is left with an execution instance that is considered to be "in progress".

          [JENKINS-29221] WorkflowRun assigned FlowExecution when execution start fails

          Tom FENNELLY added a comment -

          To reproduce, create a build with a bad script that fails the start of the run:

          {{stage 'dev'
          def hello = new HelloWorld()
          public class HelloWorld()
          { // <- invalid class definition }
          }}
          

          Tom FENNELLY added a comment - To reproduce, create a build with a bad script that fails the start of the run: {{stage 'dev' def hello = new HelloWorld() public class HelloWorld() { // <- invalid class definition } }}

          Tom FENNELLY added a comment -

          Tom FENNELLY added a comment - PR #149

          Code changed in jenkins
          User: tfennelly
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowRunTest.java
          job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
          http://jenkins-ci.org/commit/workflow-plugin/adeaf564a94ee6f82861e4253bd2d5bbc22276c4
          Log:
          [FIXED JENKINS-29221] WorkflowRun assigned FlowExecution when execution start fails

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: tfennelly Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowRunTest.java job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java http://jenkins-ci.org/commit/workflow-plugin/adeaf564a94ee6f82861e4253bd2d5bbc22276c4 Log: [FIXED JENKINS-29221] WorkflowRun assigned FlowExecution when execution start fails

          Code changed in jenkins
          User: Tom Fennelly
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowRunTest.java
          job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
          http://jenkins-ci.org/commit/workflow-plugin/727f2462606a32c026eaf716952ee0a0df7490fc
          Log:
          Merge pull request #149 from tfennelly/JENKINS-29221

          [FIXED JENKINS-29221] WorkflowRun assigned FlowExecution when execution start fails

          Compare: https://github.com/jenkinsci/workflow-plugin/compare/06cb328979c8...727f2462606a

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Tom Fennelly Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowRunTest.java job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java http://jenkins-ci.org/commit/workflow-plugin/727f2462606a32c026eaf716952ee0a0df7490fc Log: Merge pull request #149 from tfennelly/ JENKINS-29221 [FIXED JENKINS-29221] WorkflowRun assigned FlowExecution when execution start fails Compare: https://github.com/jenkinsci/workflow-plugin/compare/06cb328979c8...727f2462606a

          Code changed in jenkins
          User: Jesse Glick
          Path:
          job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
          http://jenkins-ci.org/commit/workflow-plugin/7db48c88df0ac3b35d489f6275b9f7e4d88de85c
          Log:
          JENKINS-29221 If a build fails to start, make sure we still perform all relevant steps as if it finished normally.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java http://jenkins-ci.org/commit/workflow-plugin/7db48c88df0ac3b35d489f6275b9f7e4d88de85c Log: JENKINS-29221 If a build fails to start, make sure we still perform all relevant steps as if it finished normally.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
          http://jenkins-ci.org/commit/workflow-plugin/99ca243654430737de5f3be6367c9b24ccfdf5bb
          Log:
          WorkflowRun.execution must be set before the execution starts.
          Otherwise Owner.get can throw an error claiming that the build has not started yet.
          We do need to null out the field if starting fails, but we can do that subsequently.
          Amends the fix of JENKINS-29221 in #149, which introduced this race condition.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java http://jenkins-ci.org/commit/workflow-plugin/99ca243654430737de5f3be6367c9b24ccfdf5bb Log: WorkflowRun.execution must be set before the execution starts. Otherwise Owner.get can throw an error claiming that the build has not started yet. We do need to null out the field if starting fails, but we can do that subsequently. Amends the fix of JENKINS-29221 in #149, which introduced this race condition.

          Code changed in jenkins
          User: tfennelly
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowRunTest.java
          job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
          http://jenkins-ci.org/commit/workflow-job-plugin/0827836fe4aad44feae99be53b0d825952a551f9
          Log:
          [FIXED JENKINS-29221] WorkflowRun assigned FlowExecution when execution start fails

          Originally-Committed-As: adeaf564a94ee6f82861e4253bd2d5bbc22276c4

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: tfennelly Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowRunTest.java job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java http://jenkins-ci.org/commit/workflow-job-plugin/0827836fe4aad44feae99be53b0d825952a551f9 Log: [FIXED JENKINS-29221] WorkflowRun assigned FlowExecution when execution start fails Originally-Committed-As: adeaf564a94ee6f82861e4253bd2d5bbc22276c4

          Code changed in jenkins
          User: Jesse Glick
          Path:
          job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
          http://jenkins-ci.org/commit/workflow-job-plugin/b4563b1d993293d0f7011f21a0b8a7903878edfa
          Log:
          JENKINS-29221 If a build fails to start, make sure we still perform all relevant steps as if it finished normally.

          Originally-Committed-As: 7db48c88df0ac3b35d489f6275b9f7e4d88de85c

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java http://jenkins-ci.org/commit/workflow-job-plugin/b4563b1d993293d0f7011f21a0b8a7903878edfa Log: JENKINS-29221 If a build fails to start, make sure we still perform all relevant steps as if it finished normally. Originally-Committed-As: 7db48c88df0ac3b35d489f6275b9f7e4d88de85c

          Code changed in jenkins
          User: Jesse Glick
          Path:
          job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
          http://jenkins-ci.org/commit/workflow-job-plugin/682638de3356695d2f5629c89fd7eb36248d569a
          Log:
          WorkflowRun.execution must be set before the execution starts.
          Otherwise Owner.get can throw an error claiming that the build has not started yet.
          We do need to null out the field if starting fails, but we can do that subsequently.
          Amends the fix of JENKINS-29221 in #149, which introduced this race condition.
          Originally-Committed-As: 99ca243654430737de5f3be6367c9b24ccfdf5bb

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java http://jenkins-ci.org/commit/workflow-job-plugin/682638de3356695d2f5629c89fd7eb36248d569a Log: WorkflowRun.execution must be set before the execution starts. Otherwise Owner.get can throw an error claiming that the build has not started yet. We do need to null out the field if starting fails, but we can do that subsequently. Amends the fix of JENKINS-29221 in #149, which introduced this race condition. Originally-Committed-As: 99ca243654430737de5f3be6367c9b24ccfdf5bb

            tfennelly Tom FENNELLY
            tfennelly Tom FENNELLY
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: