Skip to content

[JENKINS-59678] Add a time delay capability to the retry basic step #497

@jenkins-infra-bot

Description

@jenkins-infra-bot

dnusbaum suggested creating this ticket for an enhancement I am proposing to the retry basic step.

The retry step is a great utility step, but adding the ability to add a time delay between retries would be great. It can be as basic as adding a fixed time delay as a property to the step or an extensible option that allows you to use different algorithms for the time delay (Fixed, incremental, exponential, random, random exponential.

A pull request for the basic fixed implementation has already been created at #97 This allows the user to do something like 

retry(count: 3, useRetryDelay: true, delay: 40, units: "SECONDS").

If the more advanced implementation is desired, it has also been implemented (and can be added to the pull request. @​basil suggested modeling the extensible solution of other existing APIs that do something like this and proposed looking at Tenacity. The algorithms currently implemented are fixed, random, incremental, exponential, random Exponential. This would allow the user to do something like: 

retry(count: 3, useRetryDelay: true, delay: incremental(increment: 2, max: 10, min: 1, unit: 'SECONDS'))

All of this while still remaining backwards compatible and supporting something as simple as: 

retry(3)

 

 

 


Originally reported by krotte1, imported from: Add a time delay capability to the retry basic step
  • assignee: krotte1
  • status: Open
  • priority: Major
  • component(s): workflow-basic-steps-plugin
  • resolution: Unresolved
  • votes: 13
  • watchers: 14
  • imported: 20251215-220547
Raw content of original issue

dnusbaum suggested creating this ticket for an enhancement I am proposing to the retry basic step.

The retry step is a great utility step, but adding the ability to add a time delay between retries would be great. It can be as basic as adding a fixed time delay as a property to the step or an extensible option that allows you to use different algorithms for the time delay (Fixed, incremental, exponential, random, random exponential.

A pull request for the basic fixed implementation has already been created at #97 This allows the user to do something like 

retry(count: 3, useRetryDelay: true, delay: 40, units: "SECONDS").

If the more advanced implementation is desired, it has also been implemented (and can be added to the pull request. @basil suggested modeling the extensible solution of other existing APIs that do something like this and proposed looking at Tenacity. The algorithms currently implemented are fixed, random, incremental, exponential, random Exponential. This would allow the user to do something like: 

retry(count: 3, useRetryDelay: true, delay: incremental(increment: 2, max: 10, min: 1, unit: 'SECONDS'))

All of this while still remaining backwards compatible and supporting something as simple as: 

retry(3)

 

 

 

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions