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

dos "exit" command not functioning correctly

    Details

    • Similar Issues:

      Description

      if you attempt to run a dos batch file that has an "exit" command within it then the task does not notice that the interpreter has terminated.

      e.g. in workflow create a CPS with the following

      node {
            bat '''echo hello
      exit 1'''
            echo 'should not be seen'
      }
      

      This results in a workflow that will run forever.

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            I think I got it: use cmd rather than call in the wrapper script.

            Show
            jglick Jesse Glick added a comment - I think I got it: use cmd rather than call in the wrapper script.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/durabletask/WindowsBatchScript.java
            src/test/java/org/jenkinsci/plugins/durabletask/WindowsBatchScriptTest.java
            http://jenkins-ci.org/commit/durable-task-plugin/c0edb1d21c9963f4fe865dc024536972381d5d32
            Log:
            [FIXED JENKINS-27419] Properly handle scripts that call exit without /b.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/durabletask/WindowsBatchScript.java src/test/java/org/jenkinsci/plugins/durabletask/WindowsBatchScriptTest.java http://jenkins-ci.org/commit/durable-task-plugin/c0edb1d21c9963f4fe865dc024536972381d5d32 Log: [FIXED JENKINS-27419] Properly handle scripts that call exit without /b.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/durabletask/WindowsBatchScript.java
            src/test/java/org/jenkinsci/plugins/durabletask/WindowsBatchScriptTest.java
            http://jenkins-ci.org/commit/durable-task-plugin/807eca36b3ca37d00518e957940117dd1ea3df54
            Log:
            Merge pull request #12 from jglick/exitCommand-JENKINS-27419

            JENKINS-27419 Properly handle scripts that call exit without /b

            Compare: https://github.com/jenkinsci/durable-task-plugin/compare/d652a99ee282...807eca36b3ca

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/durabletask/WindowsBatchScript.java src/test/java/org/jenkinsci/plugins/durabletask/WindowsBatchScriptTest.java http://jenkins-ci.org/commit/durable-task-plugin/807eca36b3ca37d00518e957940117dd1ea3df54 Log: Merge pull request #12 from jglick/exitCommand- JENKINS-27419 JENKINS-27419 Properly handle scripts that call exit without /b Compare: https://github.com/jenkinsci/durable-task-plugin/compare/d652a99ee282...807eca36b3ca
            Hide
            arturkor Artur Korobeynyk added a comment -

            I've just experienced the same issue even while using the /b key and doing promotion.
            So in build promotion windows script if you do exit /b 255 it will result Pending promotion status to remain forever

            Show
            arturkor Artur Korobeynyk added a comment - I've just experienced the same issue even while using the /b key and doing promotion. So in build promotion windows script if you do exit /b 255 it will result Pending promotion status to remain forever
            Hide
            danielbeck Daniel Beck added a comment -

            Artur Korobeynyk This issue is about the Durable Task Plugin, not the Promoted Builds Plugin.

            Show
            danielbeck Daniel Beck added a comment - Artur Korobeynyk This issue is about the Durable Task Plugin, not the Promoted Builds Plugin.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                teilo James Nord
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: