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

Allow StepExecution.onResume to throw Exception

    Details

    • Similar Issues:

      Description

      Proposal:

      Change onResume to throw Exception. (Would still be binary-compatible.) FlowExecutionList.ItemListenerImpl.onLoaded would then need to catch exceptions and call StepContext.onFailure. Like AbstractStepExecutionImpl, this would rely on transient fields holding the contextual object; the improvement would be that a failure in StepContext.get would stop anything else in onResume (such as the setupTimer methods in TimeoutStepExecution, SleepStep.Execution, or DurableTaskStep.Execution) from running.

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue relates to JENKINS-39134 [ JENKINS-39134 ]
            jglick Jesse Glick made changes -
            Link This issue blocks JENKINS-37486 [ JENKINS-37486 ]
            jglick Jesse Glick made changes -
            Component/s durable-task-plugin [ 18622 ]
            jglick Jesse Glick made changes -
            Description [Proposal|https://github.com/jenkinsci/workflow-basic-steps-plugin/pull/28#discussion_r90341038]:

            Change {{onResume}} to throw {{Exception}}. (Would still be binary-compatible.) {{FlowExecutionList.ItemListenerImpl.onLoaded}} would then need to catch exceptions and call {{StepContext.onFailure}}. Like {{AbstractStepExecutionImpl}}, this would rely on {{transient}} fields holding the contextual object; the improvement would be that a failure in {{StepContext.get}} would stop anything _else_ in {{onResume}} (such as {{TimeoutStepExecution.setupTimer}} or {{SleepStep.Execution.setupTimer}}) from running.
            [Proposal|https://github.com/jenkinsci/workflow-basic-steps-plugin/pull/28#discussion_r90341038]:

            Change {{onResume}} to throw {{Exception}}. (Would still be binary-compatible.) {{FlowExecutionList.ItemListenerImpl.onLoaded}} would then need to catch exceptions and call {{StepContext.onFailure}}. Like {{AbstractStepExecutionImpl}}, this would rely on {{transient}} fields holding the contextual object; the improvement would be that a failure in {{StepContext.get}} would stop anything _else_ in {{onResume}} (such as the {{setupTimer}} methods in {{TimeoutStepExecution}}, {{SleepStep.Execution}}, or {{DurableTaskStep.Execution}}) from running.

              People

              • Assignee:
                Unassigned
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: