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

Timeouts send signals to random processes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: pipeline
    • Labels:
    • Environment:
      Jenkins 2.235.5
      Pipeline: Groovy 2.83
      Pipeline: Job 2.40
    • Similar Issues:

      Description

      Consider a following procedural (groovy) pipeline:

      ```
      timeout(1) {
          sh(script: '''
              trap 'echo "jenkins int"' SIGINT SIGTERM
              ./bash_script.sh
          ''')
      }
      ```

      where the `bash_script.sh` looks like this:

      ```bash
      trap 'echo "in bash script"' SIGINT SIGTERM
      sleep inf &
      wait -n
      ```

      When the timeout lapses, neither of these traps get fired and the SIGINT signal gets sent to the backgrounded sleep process spawned in the script.

      If you spawn multiple such background processes in a script, there appears to be no good way to tell which one received a signal and if its termination was due to a timeout signal. If the process "just" happens to exit with exit code 0 when it receives `SIGINT` then the whole step will be marked as //successful// and not "timed out".

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            nagisa Simonas Kazlauskas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: