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

Unkillable tasks

    XMLWordPrintable

Details

    Description

      If you run a flow

      node {
          sh 'rm -rf * .*'
      }
      

      this deletes the control directory for the shell step while it is running, and it becomes impossible to abort the build.

      I think this is because FileMonitoringController.exitStatus just checks if jenkins-result.txt exists yet. But if the whole control dir is missing, it should return -1 or similar.

      Similar effect if you botch the $PATH so that echo cannot be found. In that case the control dir is present, but pid is not, so the controller assumes the process is still starting! It should impose a time limit on the startup phase.

      Was ameliorated by improving DurableTaskExecution.stop to do a hard kill if you try to stop the build twice. This makes the similar JENKINS-25678 much less of a problem.

      Attachments

        Issue Links

          Activity

            jglick Jesse Glick added a comment -

            Current BourneShellScript specifically declines to copy stdout/stderr from the wrapper process to the build log, since doing so would consume a Thread, but this also makes diagnosis of this class of error harder. Should at a minimum allow the diagnosis to be enabled with a system property. Maybe it is possible to allocate a thread which stops listening after one second. Or maybe up to (say) five concurrent tasks in the system would get this diagnosis applied but subsequent ones would not, so that people experimenting with flow definitions would get the benefit of diagnosis but there would be little performance hit in busy production systems.

            jglick Jesse Glick added a comment - Current BourneShellScript specifically declines to copy stdout/stderr from the wrapper process to the build log, since doing so would consume a Thread , but this also makes diagnosis of this class of error harder. Should at a minimum allow the diagnosis to be enabled with a system property. Maybe it is possible to allocate a thread which stops listening after one second. Or maybe up to (say) five concurrent tasks in the system would get this diagnosis applied but subsequent ones would not, so that people experimenting with flow definitions would get the benefit of diagnosis but there would be little performance hit in busy production systems.
            danielbeck Daniel Beck added a comment -

            Why are these control scripts in the workspace? It's not like Batch/Shell build steps behave, they write theirs to the temp dir.

            danielbeck Daniel Beck added a comment - Why are these control scripts in the workspace? It's not like Batch/Shell build steps behave, they write theirs to the temp dir.
            jglick Jesse Glick added a comment -

            Adequately handled by other filed issues.

            jglick Jesse Glick added a comment - Adequately handled by other filed issues.

            People

              jglick Jesse Glick
              jglick Jesse Glick
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: