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

Eliminate ProcessLiveness

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      ProcessLiveness along with PID tracking was introduced as a way to ensure that a sh step would terminate if the controller process died, for example if the computer were rebooted; otherwise the step would just sit there indefinitely waiting for output or an exit status which will never come.

      In practice this code has proven to be a major source of reliability issues. Prior to Java 9 there is no standard API for checking for the existence of a given process, so the code uses JNA. Or tries to, but it has a hard time being sure whether getpgid is actually supported, so it tries to detect that on every new node and cache the answer. Anyway these calls will not work when we are inside withDockerContainer since the container may remap process IDs (the $$ seen from the wrapper script is not necessarily meaningful from the agent JVM), so the code also has to detect decorated Launcher implementations and fall back to a different version based on command-line ps calls, which is not entirely portable, and has also had troubles in responding cleanly to laggy or hung remoting channels.

      Better to throw out this approach and start over. It seems to work to just have the wrapper script itself indicate that it is still alive, for example by touching the log file even when there is no new output. Then the agent JVM need do nothing more exotic than a file timestamp check.

        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-25503 [ JENKINS-25503 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-45294 [ JENKINS-45294 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-44785 [ JENKINS-44785 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 49 (Web Link)" [ 17980 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-35370 [ JENKINS-35370 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-39307 [ JENKINS-39307 ]
            jglick Jesse Glick made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-42166 [ JENKINS-42166 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "Page (Jenkins Wiki)" [ 18025 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-46651 [ JENKINS-46651 ]
            iceiceice Alexey Grigorov made changes -
            Link This issue is blocking JENKINS-47822 [ JENKINS-47822 ]
            basil Basil Crow made changes -
            Link This issue relates to JENKINS-48300 [ JENKINS-48300 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-42405 [ JENKINS-42405 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-38682 [ JENKINS-38682 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-37720 [ JENKINS-37720 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-50892 [ JENKINS-50892 ]

              People

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

                Dates

                Created:
                Updated:
                Resolved: