Jenkins : Build-timeout Plugin

Plugin Information

View Build Timeout on the plugin site for more information.

This plugin allows you to automatically abort a build if it's taking too long.

Once the timeout is reached, Jenkins behaves as if an invisible hand has clicked the "abort build" button.

This plugin isn't applicable to pipelines.
Use timeout step in workflow-basic-steps instead.

Instructions:

After installing the plugin, go to the configure page for your job and select "Abort the build if it's stuck".

Because Java only allows threads to be interrupted at a set of fixed locations, depending on how a build hangs, the abort operation might not take effect. For example,

  • if Jenkins is waiting for child processes to complete, it can abort right away.
  • if Jenkins is stuck in an infinite loop, it can never be aborted.
  • if Jenkins is doing a network or file I/O within the Java VM (such as lengthy file copy or SVN update), it cannot be aborted.

So if you think the build time out isn't taking effect, our default assumption is that the build is hanging at the place that cannot be interrupted. If you suspect otherwise, please obtain the thread dump and report it.

Time-out actions with notes

Time-out action

Note

Abort and restart the build

Installing Naginator Plugin enables this action

History

Version 1.19 (Oct 8, 2017)

  • Targets Jenkins 1.625.1 (Pull request #64)
    • You no longer need matrix-project plugin and so on to install build-timeout plugin
  • Improved Japanese translations (Pull request #63)

Version 1.18 (Nov 13, 2016)

  • Introduced "Run with timeout" build step (PR61)

Version 1.17.1 (Jul 19, 2016)

  • Fixed: a stacktrace is output when Jenkins launches without naginator-plugin (JENKINS-36696)

Version 1.17 (Jun 26, 2016)

  • A new time-out action: Abort and restart the build (JENKINS-8947)
  • Clarified the help text of 'likely stuck' (#48)
  • The previous help text simply referenced the source code, which isn't helpful for most users.

Version 1.16.1 (Jun 20, 2016)

  • No change from 1.16.
  • Just to suppress the wrong version in the update center (#56)

Version 1.16 (Jan 24, 2015)

  • Introduced fail safe timeout duration for ElasticTimeOutStrategy (JENKINS-30564).

Version 1.15.1 (Nov 21, 2015)

Version 1.15 (Jul 26, 2015)

Version 1.14.1 (Jan 03, 2015)

  • FIXED: timeout actions don't defaults to 'abort build' when no option is selected (JENKINS-23740)
  • Added license notice (MIT) (JENKINS-21270)
  • Improved the performance of NoActivityTimeOutStrategy (JENKINS-26170)

Version 1.14 (Jun 01, 2014)

  • Now targets Jenkins 1.466.
  • This version breaks binary compatibility.
    • This can affect you onlt in following cases (In other words, this does not affect most users)
      • When you have private plugins accessing inner information of Build-timeout plugin.
      • When you have groovy scripts accessing inner information of Build-timeout plugin.
  • Resolved a performance problem introduced in 1.13 by capturing log outputs. (JENKINS-23012)
  • Use dropdown for strategy instead of hetero-radio, as it can conflicts with other plugins. (JENKINS-20164)
  • FIXED: Enable BuildStep Action in System Configuration page was not saved to the disk. (JENKINS-23118)
  • Supported launcher in Perform Buildstep. (JENKINS-23117)
  • Allow use of ${...} style expressions in defining the build timeouts. (JENKINS-9457, JENKINS-19773, JENKINS-20526)

Version 1.13 (Mar 29, 2014)

  • Added "No Activity" timeout strategy, which triggers timeout when no log output for specified seconds. (JENKINS-13349)
  • Actions performed when timeout occurs can be extended using extension points. (issue #21919)
  • expose the build timeout milliseconds with an environment variable
  • "Perform BuildStep" timeout action is added. It allows you to trigger any build step when timeout.
    • It does not ensure any build steps work correctly.
    • As it is provided as an advanced feature, you need to enable it in System Configuration page to enable in project configuration pages.

Version 1.12.2 (Oct 14, 2013)

  • Fixed missing strategies selection when a new job is created (JENKINS-19592)
  • Fixed missing label selecting time-out strategy

Version 1.12 (Sep 7, 2013)

  • Fix elastic timout (pull #12).
  • Define an extension point for time-out strategy (pull #14).
  • Build Timeout Plugin configuration interface shows all sub options (JENKINS-18618).

Version 1.11 (Oct 28, 2012)

  • Change to build timeout job configuration not saved (JENKINS-14158).
  • Clarified timeoutMinutesElasticDefault's name (pull #11).

Version 1.10 (Jun 16, 2012)

  • Build timeout plugin 1.9 always sets timeout period to 3 minutes ([]).
  • updated to LTS 1.447
  • updated Japanese localization.

Version 1.9 (March 12, 2012)

  • amend build description on timeout
  • elastic timeout option to define timeout as a percent of previous build duration
  • "likely stuck" option

Version 1.8 (Aug 27, 2011)

  • Marking a build as failed works now as expected.
  • Japanese translation

Version 1.7 (Mar 20, 2011)

  • Clarify in help text that marking build as failed instead of aborted does still abort the build.
  • Write more detail in log when build is aborted.

Version 1.6 (Dec 28, 2009)

  • Remove debug output
  • Update uses of deprecated APIs

Version 1.5

  • Option to mark builds as failed or aborted.

Version 1.4

  • The plugin now works with the native maven2 job type as well as the matrix job type.

Issues

To report a bug or request an enhancement to this plugin please create a ticket in JIRA (you need to login or to sign up for an account). Also have a look on How to report an issue


Attachments: