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

Add support of Timeout option to Jenkinsfile Runner

    XMLWordPrintable

Details

    Description

      Currently Jenkinsfile Runner does not support passing timeout to CLI. In Docker it may be worked around by timing out the Docker container, but in such case there is no way to have a graceful shutdown.

      timeout() is not enough, because Jenkins may hang before Pipeline even starts. 

      Acceptance criteria:

      • There is a soft and hard timeout options which may be set via CLI argument or passed via Environment variable (for Docker)
      • If the option is set, timeout is applied to the execution
      • Once the soft timeout happens, Jenkins instance termination is invoked (job termination and then instance shutdown)
      • Once the hard timeout happens, Jenkins instance is forcefully aborted

       

       

      Attachments

        Activity

          jglick Jesse Glick added a comment -

          What is the use case for this? The Jenkinsfile may already include a timeout step which performs a graceful termination of nested steps (including processing of StepExecution.stop, finally blocks, SimpleBuildWrapper.Disposer, etc.); and a global hard timeout as a defense against Pipeline infrastructure bugs (for example some pathological cases of JENKINS-39072: see TimeoutStepTest.veryUnresponsiveBody) can be accomplished with /usr/bin/timeout, Kubernetes configuration, etc.

          jglick Jesse Glick added a comment - What is the use case for this? The Jenkinsfile may already include a timeout step which performs a graceful termination of nested steps (including processing of StepExecution.stop , finally blocks, SimpleBuildWrapper.Disposer , etc.); and a global hard timeout as a defense against Pipeline infrastructure bugs (for example some pathological cases of JENKINS-39072 : see TimeoutStepTest.veryUnresponsiveBody ) can be accomplished with /usr/bin/timeout , Kubernetes configuration, etc.

          Let's close it then since it can always be reopened.

          egutierrez Evaristo Gutierrez added a comment - Let's close it then since it can always be reopened.
          oleg_nenashev Oleg Nenashev added a comment -

          I am reopening it for the discussion

          oleg_nenashev Oleg Nenashev added a comment - I am reopening it for the discussion

          People

            Unassigned Unassigned
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: