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

Record process ID of spawned process

    Details

    • Similar Issues:

      Description

      Currently BourneShellScript does not try to track the PID of the external process; it assumes that it runs to completion (successfully or not) and then writes the status file. But if the wrapping shell script is killed, or the machine rebooted, this might never occur and the task would hang.

      Better to record $$ from the outer sh process and override exitStatus in case no such process still exists. Implies some use of native code.

      (TBD whether an analogous fix can be done for Windows as well.)

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment - - edited

            Filed JENKINS-25053 for Windows.

            Show
            jglick Jesse Glick added a comment - - edited Filed JENKINS-25053 for Windows.
            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/BourneShellScript.java
            src/main/java/org/jenkinsci/plugins/durabletask/FileMonitoringTask.java
            src/main/java/org/jenkinsci/plugins/durabletask/ProcessLiveness.java
            http://jenkins-ci.org/commit/durable-task-plugin/41a11fb64845238e641fb005bb6bb7226407402d
            Log:
            [FIXED JENKINS-22249] Detect if the wrapper shell script is dead, for example because the machine was rebooted.

            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/BourneShellScript.java src/main/java/org/jenkinsci/plugins/durabletask/FileMonitoringTask.java src/main/java/org/jenkinsci/plugins/durabletask/ProcessLiveness.java http://jenkins-ci.org/commit/durable-task-plugin/41a11fb64845238e641fb005bb6bb7226407402d Log: [FIXED JENKINS-22249] Detect if the wrapper shell script is dead, for example because the machine was rebooted.
            Hide
            jglick Jesse Glick added a comment -

            Using a cached ProcessTree does not seem reliable, and was probably inefficient anyway.

            Show
            jglick Jesse Glick added a comment - Using a cached ProcessTree does not seem reliable, and was probably inefficient anyway.
            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/BourneShellScript.java
            src/main/java/org/jenkinsci/plugins/durabletask/ProcessLiveness.java
            http://jenkins-ci.org/commit/durable-task-plugin/d75ffad16c40c0018fd6e71499f6b6e96048798f
            Log:
            [FIXED JENKINS-22249] Rewrote ProcessLiveness to use a simple [ -d /proc/$pid ] check.

            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/BourneShellScript.java src/main/java/org/jenkinsci/plugins/durabletask/ProcessLiveness.java http://jenkins-ci.org/commit/durable-task-plugin/d75ffad16c40c0018fd6e71499f6b6e96048798f Log: [FIXED JENKINS-22249] Rewrote ProcessLiveness to use a simple [ -d /proc/$pid ] check.
            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/BourneShellScript.java
            http://jenkins-ci.org/commit/durable-task-plugin/88aed023e5d37fdae0d1e0c05acd7cabbdf6fd7f
            Log:
            JENKINS-22249 Do not bother checking process existence if we just started it.

            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/BourneShellScript.java http://jenkins-ci.org/commit/durable-task-plugin/88aed023e5d37fdae0d1e0c05acd7cabbdf6fd7f Log: JENKINS-22249 Do not bother checking process existence if we just started it.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml http://jenkins-ci.org/commit/workflow-plugin/7f63d35b76eeb7140c4807af0209d2380bc65a54 Log: durable-task 0.7 to pick up reworked JENKINS-22249 fix. Compare: https://github.com/jenkinsci/workflow-plugin/compare/a3f94a7e0296...7f63d35b76ee

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: