Is pipeline timeout suppose to work?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Is pipeline timeout suppose to work?

jerome-2

HI,
is the timeout can be used to prevent the warnings publisher and bat hang even possible?

stage('Build')
{
timeout(60)
{
bat returnStatus: false, script: "\"${bcad.msbuild_current}\" ${bcad.msbuild_solution_name} ${bcad.msbuild_default_arg} /t:Build"
step([$class: 'WarningsPublisher', canRunOnFailed: true, consoleParsers: [[parserName: 'MSBuild']]])
}
}


and it have hang for over 3 hours now :-(
I was hoping to at least be able to stop those nasty hanging build and make them failed but doesn't seem to work. maybe I'm using timeout wrongly or the default units is not min like the doc and example said???



--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8e24ad7b-cb94-4505-8819-e1592c4f2b49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is pipeline timeout suppose to work?

Danny Rehelis

On Fri, Jul 7, 2017 at 10:46 PM <[hidden email]> wrote:

HI,
is the timeout can be used to prevent the warnings publisher and bat hang even possible?

stage('Build')
{
timeout(60)
{
bat returnStatus: false, script: "\"${bcad.msbuild_current}\" ${bcad.msbuild_solution_name} ${bcad.msbuild_default_arg} /t:Build"
step([$class: 'WarningsPublisher', canRunOnFailed: true, consoleParsers: [[parserName: 'MSBuild']]])
}
}


and it have hang for over 3 hours now :-(
I was hoping to at least be able to stop those nasty hanging build and make them failed but doesn't seem to work. maybe I'm using timeout wrongly or the default units is not min like the doc and example said???



--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8e24ad7b-cb94-4505-8819-e1592c4f2b49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAObRFCV%2BqvxaB-XDGA6n_HmyFzxz%3DBkg34OxOFp19c4nrO_A_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is pipeline timeout suppose to work?

jerome-2
When trying the 45 minutes units into the syntax helper (pipeline-syntax/ of the project) it display the following code:
timeout(45) {
    // some block
}

If I change the unit the syntax change like follow:
timeout(time: 45, unit: 'SECONDS') {
    // some block
}

So I will try with the following too see if it change something:
timeout(time: 45, unit: 'MINUTES') {
    // some block
}

The document seem to specify the timeout goes into the options block when using declarative pipeline (which I don't), but for normal pipeline I guess the //some block above is for any code block or is a block a specific type (stage, node...) ? This is unclear.
If this is any code block, it doesn't seem to work with either bat or steps warning publisher, which I cannot interrupt by cancelling the build into the GUI, so I guess the timeout may not cancel them either.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1ff554c4-b80e-4224-85cd-10f5da6e1d16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is pipeline timeout suppose to work?

Jakub Pawlinski
In reply to this post by jerome-2
I use this on pipeline level and it works fine there, haven't tried on stage level tho.

pipeline {
options {
timeout(time: 12, unit: 'HOURS')
timestamps()
}
...
}

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b0379985-baa7-4201-9b4f-5a19636151f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is pipeline timeout suppose to work?

jerome-2
This is Declarative pipeline syntax (which I don't use), for non Declarative pipeline (which is what I have), I wonder if this work the same or where it can be used?

On Tuesday, July 11, 2017 at 5:31:08 AM UTC-4, Jakub Pawlinski wrote:
I use this on pipeline level and it works fine there, haven't tried on stage level tho.

pipeline {
options {
timeout(time: 12, unit: 'HOURS')
timestamps()
}
...
}

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8e3e104b-9cf2-49b0-bdc2-572865691d8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is pipeline timeout suppose to work?

jerome-2
I think I got my answer about it into the console log after a hang, I had to restart the jenkins service and got this as a result:

04:18:53 
04:18:53 Build succeeded.
04:18:53     0 Warning(s)
04:18:53     0 Error(s)
04:18:53
04:18:53 Time Elapsed 00:14:25.77
Waiting to resume part of Bodycad cpp projects » CAD_CPP_ContinuousBuild #172: JGMachine is offline
Waiting to resume part of Bodycad cpp projects » CAD_CPP_ContinuousBuild #172: JGMachine is offline
Ready to run at Wed Jul 12 10:50:34 EDT 2017
10:50:34 Timeout expired 5 hr 46 min ago
10:50:34 Cancelling nested steps due to timeout
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] echo
Error occurred during build:
[Pipeline] echo
java.lang.Exception: Resume after a restart not supported for non-blocking synchronous steps

the line: 
10:50:34 Timeout expired 5 hr 46 min ago
tell me that it cannot be used that way.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c424e3d8-fdc5-4c65-8fc9-c84dbaf6dd61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...