-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Jenkins ver. 2.89.4
Hubot Pipeline Steps 2.0.0
If using hubotApprove inside timeout() in Jenkins (scripted) pipeline effective time it takes to terminate approve request seems to double;
Example code:
timestamps {
timeout(time:15, unit:'SECONDS') {
env.HUBOT_URL = Constants.HUBOT_URL
hubotApprove message: "test message",
room: '#jenkins-devel', submitter: 'mjuuti',
failOnError: 'true'
}
}
Console output:
00:00:01.397 Timeout set to expire in 15 sec
[Pipeline] {
[Pipeline] hubotApprove
00:00:01.409 Hubot: ROOM - #jenkins-devel - Approval Message - test message
00:00:01.568 Hubot: Successful. Code: 200
00:00:01.571 test message
00:00:01.572 Proceed or Abort
00:00:16.397 Cancelling nested steps due to timeout
00:00:31.397 Body did not finish within grace period; terminating with extreme prejudice
e.g. 15 second timeout went off at 16 seconds but process was script body was forcibly terminated only after 15 seconds after that (2x timeout, tested with different values).
This probably is bug in timeout plugin https://issues.jenkins-ci.org/browse/JENKINS-40839
But I suppose on improvement side in this plugin try/catch could check first if catch org.jenkinsci.plugins.workflow.steps.FlowInterruptedException (or probably any standard 'abort' exception) has been thrown and then terminate immediately.
My domain knowledge is minimal at best and Java isn't strong with this one either but I suppose https://github.com/jenkinsci/hubot-steps-plugin/blob/master/src/main/java/org/thoughtslive/jenkins/plugins/hubot/service/HubotService.java#L57 might be the culprit by catching all exceptions and not throwing?
This happens with both failOnError as 'true' or 'false'