[JIRA] (JENKINS-54735) Pipeline retry clause: optionally delay between retries
Title: Message Title asgeirn edited a comment on JENKINS-54735 Re: Pipeline retry clause: optionally delay between retries Here's a different approach:{code:groovy}timeout(10) {waitUntil {script {def r = sh returnStatus: true, script: 'command'return r == 0}}}{code}This will retry for up to 10 minutes. ` {{ waitUntil ` }} automatically adds delays between the attempts. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54735) Pipeline retry clause: optionally delay between retries
Title: Message Title asgeirn edited a comment on JENKINS-54735 Re: Pipeline retry clause: optionally delay between retries Here's a different approach:{code:groovy}timeout(10) {waitUntil {script {def r = sh returnStatus: true, script: 'command'return r == 0}}}{code}This will retry for up to 10 minutes. `waitUntil` automatically adds delays between the attempts. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54735) Pipeline retry clause: optionally delay between retries
Title: Message Title asgeirn edited a comment on JENKINS-54735 Re: Pipeline retry clause: optionally delay between retries Here's a different approach:{ { code:groovy} timeout(10) {waitUntil {script {def r = sh returnStatus: true, script: 'command'return r == 0}}} {code } } This will retry for up to 10 minutes. `waitUntil` automatically adds delays between the attempts. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54735) Pipeline retry clause: optionally delay between retries
Title: Message Title asgeirn edited a comment on JENKINS-54735 Re: Pipeline retry clause: optionally delay between retries Here's a different approach:{{ timeout(10) {waitUntil {script {def r = sh returnStatus: true, script: 'command'return r == 0}}} }}This will retry for up to 10 minutes. `waitUntil` automatically adds delays between the attempts. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54735) Pipeline retry clause: optionally delay between retries
Title: Message Title asgeirn edited a comment on JENKINS-54735 Re: Pipeline retry clause: optionally delay between retries Here's a different approach: {{ timeout(10) {waitUntil {script {def r = sh returnStatus: true, script: 'command'return r == 0}}} }} This will retry for up to 10 minutes. `waitUntil` automatically adds delays between the attempts. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54735) Pipeline retry clause: optionally delay between retries
Title: Message Title asgeirn commented on JENKINS-54735 Re: Pipeline retry clause: optionally delay between retries Here's a different approach: timeout(10) { waitUntil { script { def r = sh returnStatus: true, script: 'command' return r == 0 } } } This will retry for up to 10 minutes. `waitUntil` automatically adds delays between the attempts. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54735) Pipeline retry clause: optionally delay between retries
Title: Message Title Adam Brousseau commented on JENKINS-54735 Re: Pipeline retry clause: optionally delay between retries in response to the workaround, what about this...? ret = false retry(5) { if (ret) { sleep time: 30, unit: 'SECONDS' } else { ret = true } sh 'some-failure-prone-script' } Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54735) Pipeline retry clause: optionally delay between retries
Title: Message Title Steve Mokris edited a comment on JENKINS-54735 Re: Pipeline retry clause: optionally delay between retries A workaround in the meantime: { { code} retry(5) { }} {{ ret = sh returnStatus: true, script: 'some-failure-prone-script' }} {{ if (ret) { }} {{ sleep time: 30, unit: 'SECONDS' }} {{ error ' }}{{ some-failure-prone-script failed' }} {{ } }} {{ } {code } } …but there's no way to know when we're on the last retry attempt (see JENKINS-49341), so it unnecessarily waits 30 seconds when after the last retry attempt fails. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54735) Pipeline retry clause: optionally delay between retries
Title: Message Title Steve Mokris commented on JENKINS-54735 Re: Pipeline retry clause: optionally delay between retries A workaround in the meantime: retry(5) { ret = sh returnStatus: true, script: 'some-failure-prone-script' if (ret) { sleep time: 30, unit: 'SECONDS' error 'some-failure-prone-script failed' {{ }}} {{ }}} …but there's no way to know when we're on the last retry attempt (see JENKINS-49341), so it unnecessarily waits 30 seconds when the last retry attempt fails. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54735) Pipeline retry clause: optionally delay between retries
Title: Message Title Steve Mokris created an issue Jenkins / JENKINS-54735 Pipeline retry clause: optionally delay between retries Issue Type: Improvement Assignee: Unassigned Components: workflow-basic-steps-plugin Created: 2018-11-20 17:24 Labels: pipeline Priority: Major Reporter: Steve Mokris I use a retry block to perform requests on a remote server that I don't control (e.g., Apple's Code Signing or Notarization service), and sometimes that remote server is offline. Currently retry immediately retries upon failure, so when the remote server is offline for an extended period of time, my pipeline project quickly retries and then the build fails. It would be nice to have the ability to make retry wait after each failure, with optional exponential backoff (doubling the wait time after each failure), to give these builds a greater chance of success. For example: retry(tries:5, waitSecondsBetweenFailures:30, doubleWaitTimeAfterEachFailure:true) Add Comment