ShellController.exitStatus if more than a minute has elapsed since doLaunch, and still _pid == 0, return -2

      Also consider uncommenting ps.stdout(listener) under some conditions.

          [JENKINS-28400] Not timing out when launch pid fails to appear

          Oleg Nenashev added a comment - - edited

          We got into such issue in JENKINS-28821. The build may hang infinitely, because durable-task's callback may be unable able to write pidfile and other metadata from the docker run. In such case the server side will never get a termination event.

          Sample code:

          // The temporary variable is to ensure JENKINS_SERVER_COOKIE=durable-… does not appear even in argv[], lest it be confused with the environment.
                  String cmd = String.format("echo $$ > '%s'; jsc=%s; %s=$jsc '%s' > '%s' 2>&1; echo $? > '%s'",
                          c.pidFile(ws),
                          cookieValue,
                          cookieVariable,
                          shf,
                          c.getLogFile(ws),
                          c.getResultFile(ws)
                          )./* escape against EnvVars jobEnv in LocalLauncher.launch */replace("$", "$$");
          

          The script is error-prone. If it is not being launched, Durable task thinks the task thinks the task is running => we need an additional flag as a workaround

          Oleg Nenashev added a comment - - edited We got into such issue in JENKINS-28821 . The build may hang infinitely, because durable-task's callback may be unable able to write pidfile and other metadata from the docker run. In such case the server side will never get a termination event. Sample code: // The temporary variable is to ensure JENKINS_SERVER_COOKIE=durable-… does not appear even in argv[], lest it be confused with the environment. String cmd = String.format("echo $$ > '%s'; jsc=%s; %s=$jsc '%s' > '%s' 2>&1; echo $? > '%s'", c.pidFile(ws), cookieValue, cookieVariable, shf, c.getLogFile(ws), c.getResultFile(ws) )./* escape against EnvVars jobEnv in LocalLauncher.launch */replace("$", "$$"); The script is error-prone. If it is not being launched, Durable task thinks the task thinks the task is running => we need an additional flag as a workaround

          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/27ed9917ef9a54b2dc6777aceae627384fcfeeb1
          Log:
          [FIXED JENKINS-28400] If the PID does not appear after 15s, assume the launch failed.

          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/27ed9917ef9a54b2dc6777aceae627384fcfeeb1 Log: [FIXED JENKINS-28400] If the PID does not appear after 15s, assume the launch failed.

          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/45ce6e4ff069baa0b33073e716fdc759c2b8914e
          Log:
          JENKINS-28400 Display diagnostics the first time a process is launched in a given workspace.

          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/45ce6e4ff069baa0b33073e716fdc759c2b8914e Log: JENKINS-28400 Display diagnostics the first time a process is launched in a given workspace.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/org/jenkinsci/plugins/durabletask/BourneShellScript.java
          src/main/java/org/jenkinsci/plugins/durabletask/WindowsBatchScript.java
          http://jenkins-ci.org/commit/durable-task-plugin/fa1959dec3984127afe02ca9f65339500d2e0512
          Log:
          Merge pull request #17 from jglick/launch-failure-JENKINS-28400

          JENKINS-28400 Better handle failure to start wrapper sh script

          Compare: https://github.com/jenkinsci/durable-task-plugin/compare/7f14ad2fab13...fa1959dec398

          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/WindowsBatchScript.java http://jenkins-ci.org/commit/durable-task-plugin/fa1959dec3984127afe02ca9f65339500d2e0512 Log: Merge pull request #17 from jglick/launch-failure- JENKINS-28400 JENKINS-28400 Better handle failure to start wrapper sh script Compare: https://github.com/jenkinsci/durable-task-plugin/compare/7f14ad2fab13...fa1959dec398

            jglick Jesse Glick
            tfennelly Tom FENNELLY
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: