[JIRA] (JENKINS-60994) When using top level agents and timeouts, provisioning time is not accounted for

10 views
Skip to first unread message

jtaboada@cloudbees.com (JIRA)

unread,
Feb 6, 2020, 5:28:03 AM2/6/20
to jenkinsc...@googlegroups.com
Jose Blas Camacho Taboada created an issue
 
Jenkins / New Feature JENKINS-60994
When using top level agents and timeouts, provisioning time is not accounted for
Issue Type: New Feature New Feature
Assignee: Jose Blas Camacho Taboada
Components: pipeline-model-definition-plugin
Created: 2020-02-06 10:27
Priority: Minor Minor
Reporter: Jose Blas Camacho Taboada

When using the following pipeline,

pipeline {
    agent any
    options {
        timeout(time: 10, unit: "MINUTES")
    }
    stages {
        stage("foo") {
            steps {
                echo "hello"
            }
        }
    }
}

Provisioning time is not accounted for in the timeout, this is the script generated:

3  node [{label=null}]
4   { []
5   timeout [{unit=MINUTES, time=10}]
6    { []
7    stage [{name=foo}]
8     { (foo) []
9     echo [{message=hello}]
10    } []
11    // stage []
12    stage [{name=boo}]
13     { (boo) []
14     echo [{message=hello buddy}]
15    } []
16    // stage []
17   } []
18   // timeout []
19  } []
20  // node []

Proposal:

Only should work iff top level agent (agent not none) and timeout in top level option.

pipeline {
    agent any
    options {
        provisioningTimeout()
        timeout(time: 10, unit: "MINUTES")
    }
    stages {
        stage("foo") {
            steps {
                echo "hello"
            }
        }
        stage("boo") {
            steps {
                echo "hello"
            }
        }
    }
}

would produce a top level timeout script

3  timeout {unit=MINUTES, time=10}
4   { 
5   node {label=null}
6    { 
7    stage {name=foo}
8     { (foo) 
9     echo {message=hello}
10    } 
11    // stage 
12    stage {name=boo}
13     { (boo) 
14     echo {message=hello buddy}
15    } 
16    // stage 
17   } 
18   // node 
19  } 
20  // timeout 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

jtaboada@cloudbees.com (JIRA)

unread,
Feb 6, 2020, 5:29:02 AM2/6/20
to jenkinsc...@googlegroups.com
Jose Blas Camacho Taboada started work on New Feature JENKINS-60994
 
Change By: Jose Blas Camacho Taboada
Status: Open In Progress

jtaboada@cloudbees.com (JIRA)

unread,
Feb 6, 2020, 5:30:02 AM2/6/20
to jenkinsc...@googlegroups.com
Jose Blas Camacho Taboada updated an issue
When using the following pipeline,
{code:groovy}

pipeline {
    agent any
    options {
        timeout(time: 10, unit: "MINUTES")
    }
    stages {
        stage("foo") {
            steps {
                echo "hello"
            }
        }
        stage("boo") {
            steps {
                echo "hello buddy"
    }
}
    }
}
{code}


Provisioning time is not accounted for in the timeout, this is the script generated:
{code:groovy}

3  node [{label=null}]
4   { []
5   timeout [{unit=MINUTES, time=10}]
6    { []
7    stage [{name=foo}]
8     { (foo) []
9     echo [{message=hello}]
10    } []
11    // stage []
12    stage [{name=boo}]
13     { (boo) []
14     echo [{message=hello buddy}]
15    } []
16    // stage []
17   } []
18   // timeout []
19  } []
20  // node []
{code}

h1. *Proposal:*

Only should work iff top level agent (agent not none) and timeout in top level option.

{code:groovy}

pipeline {
    agent any
    options {
        provisioningTimeout()
        timeout(time: 10, unit: "MINUTES")
    }
    stages {
        stage("foo") {
            steps {
                echo "hello"
            }
        }
        stage("boo") {
            steps {
                echo "hello buddy "
            }
        }
    }
}
{code}

would produce a top level timeout script

{code:groovy}

3  timeout {unit=MINUTES, time=10}
4   {
5   node {label=null}
6    {
7    stage {name=foo}
8     { (foo)
9     echo {message=hello}
10    }
11    // stage
12    stage {name=boo}
13     { (boo)
14     echo {message=hello buddy}
15    }
16    // stage
17   }
18   // node
19  }
20  // timeout

{code}

jtaboada@cloudbees.com (JIRA)

unread,
Feb 6, 2020, 11:42:04 AM2/6/20
to jenkinsc...@googlegroups.com
Jose Blas Camacho Taboada updated an issue
Only should work iff top level agent (agent not none) and timeout in top level option . , as stage level timeout

{code:groovy}
pipeline {
    agent any
    options {
        timeout(time: 10, unit: "MINUTES")
    }
    stages {
        stage("foo") {
            steps {
                echo "hello"
            }
        }
        stage("boo") {
            steps {
                echo "hello buddy"
            }
        }
    }
}
{code}

jtaboada@cloudbees.com (JIRA)

unread,
Feb 6, 2020, 11:42:04 AM2/6/20
to jenkinsc...@googlegroups.com

jtaboada@cloudbees.com (JIRA)

unread,
Feb 6, 2020, 11:42:04 AM2/6/20
to jenkinsc...@googlegroups.com

jtaboada@cloudbees.com (JIRA)

unread,
Feb 12, 2020, 12:44:02 PM2/12/20
to jenkinsc...@googlegroups.com
Status: In Progress Open
Reply all
Reply to author
Forward
0 new messages