RE: Is pipeline timeout suppose to work?

2019-04-11 Thread Reinhold Füreder
Hi Kevin,

I have used “timeout” step in the past and as far as I can remember it worked 
as expected.

Note, however, that I may not have put the “node(…)” step inside the “timeout” 
step; not sure if that is of any relevance though…

HTH Reinhold


From: jenkinsci-users@googlegroups.com  On 
Behalf Of Kevin Chow
Sent: Mittwoch, 10. April 2019 20:17
To: Jenkins Users 
Subject: Re: Is pipeline timeout suppose to work?

Hi Jer,

I'd like to followup if you figured out how to do timeout with Jenkins Scripted 
Pipeline. I'm looking into a solution to resolve it.

I have something like but it doesn't work out for me.

timeout(5) {
node("docker") {
sh"""
//do something
"""
}
}


Thanks,

Kevin

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/VI1P190MB035763094F6CAA424C57F72F0%40VI1P190MB0111.EURP190.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Re: Is pipeline timeout suppose to work?

2019-04-10 Thread Kevin Chow
Hi Jer,

I'd like to followup if you figured out how to do timeout with Jenkins 
Scripted Pipeline. I'm looking into a solution to resolve it. 

I have something like but it doesn't work out for me.

timeout(5) {
node("docker") {
sh"""
//do something
"""
}
}



Thanks,

Kevin



On Wednesday, July 12, 2017 at 7:55:33 AM UTC-7, jer...@bodycad.com wrote:
>
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e67e9e53-7e45-4426-83d1-fa062ef15d19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is pipeline timeout suppose to work?

2017-07-12 Thread jerome
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 jenkinsci-users+unsubscr...@googlegroups.com.
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.


Re: Is pipeline timeout suppose to work?

2017-07-11 Thread jerome
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 jenkinsci-users+unsubscr...@googlegroups.com.
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.


Re: Is pipeline timeout suppose to work?

2017-07-11 Thread Jakub Pawlinski
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 jenkinsci-users+unsubscr...@googlegroups.com.
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.


Re: Is pipeline timeout suppose to work?

2017-07-10 Thread jerome
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 jenkinsci-users+unsubscr...@googlegroups.com.
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.


Re: Is pipeline timeout suppose to work?

2017-07-07 Thread Danny Rehelis
It is definitely working, your syntax maybe a bit off.
Have a look here: https://jenkins.io/doc/book/pipeline/syntax/
and here:
https://support.cloudbees.com/hc/en-us/articles/226554067-Pipeline-How-to-add-an-input-step-with-timeout-that-continues-if-timeout-is-reached-using-a-default-value


On Fri, Jul 7, 2017 at 10:46 PM  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 jenkinsci-users+unsubscr...@googlegroups.com.
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
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.


Is pipeline timeout suppose to work?

2017-07-07 Thread jerome



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 jenkinsci-users+unsubscr...@googlegroups.com.
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.