Details
-
Bug
-
Status: Resolved (View Workflow)
-
Major
-
Resolution: Duplicate
-
None
-
Jenkins 2.27 workflow-basic-steps-plugin 2.2
Description
having a code such as:
node('master') { timeout (10) { retry(2) { try { sh "while true; do; sleep 2; done" } catch (e) { echo "wont ever run as theres no exception coming out from the timeout" } } } }
leds to the first retry to end due a (supposedly) internal exception being thrown but go on with the second one.
Shouldnt timeouts forbid retrying? Besides, timeouts won't throw an exception as the last echo won't ever happen
Attachments
Issue Links
- duplicates
-
JENKINS-39072 timeout step should include more logging/diagnostics information
-
- Resolved
-
As of
JENKINS-39072, if the body fails to terminate within a given period of time—for example, because you have caught the timeout exception and decided to continue—after a grace period the body will be forcibly killed.In this case it is better to put retry outside timeout rather than inside.