[JIRA] (JENKINS-42340) stage launches agent even when not required

2 views
Skip to first unread message

domi@fortysix.ch (JIRA)

unread,
Feb 27, 2017, 5:19:01 AM2/27/17
to jenkinsc...@googlegroups.com
Dominik Bartholdi updated an issue
 
Jenkins / Bug JENKINS-42340
stage launches agent even when not required
Change By: Dominik Bartholdi
Summary: run stage launches agent even when not required
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

domi@fortysix.ch (JIRA)

unread,
Feb 27, 2017, 5:20:01 AM2/27/17
to jenkinsc...@googlegroups.com
Dominik Bartholdi updated an issue
given the following pipeline, I would expect the "with NO agent" stage to trigger without any agent being launched. This is not the case, all stages are launched with an agent. This is specially a problem when I have an "input" step waiting for a user interaction in one of the stages defined.

{noformat}
pipeline {
    agent any
    tools {
        jdk "Oracle JDK 1.8 (latest)"
    }    
    stages {
        stage ('with any agent 0') {
            steps
                sh "java -version"
            }
        }  
        stage ('with NO agent') {
            agent none
            steps {
                sh "java -version"
            }
        }
        stage ('with any agent 1') {
            steps {
                sh "java -version"
            }
        }        
    }
}
{noformat}

This is also the case where "with NO agent" is the first stage in the pipeline.

btw. I was only able to discover this because of JENKINS-42338 - I think it would also be a good idea to have the "stage" step print some info on which agent it actually runs.

andrew.bayer@gmail.com (JIRA)

unread,
Feb 27, 2017, 2:29:02 PM2/27/17
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Bug JENKINS-42340
 
Re: stage launches agent even when not required

There is no way to "leave" the node block once we've entered it without releasing the executor slot and having to get it back later, at which point there's no guarantee of the same workspace, etc...not to mention that it's a pain to figure out how to scope the blocks in this kind of scenario. So yeah, agent none does nothing unless at the top level.

domi@fortysix.ch (JIRA)

unread,
Feb 27, 2017, 2:32:01 PM2/27/17
to jenkinsc...@googlegroups.com

and how would you define an input step which can wait for say 2 days?

domi@fortysix.ch (JIRA)

unread,
Feb 27, 2017, 2:34:01 PM2/27/17
to jenkinsc...@googlegroups.com
Dominik Bartholdi edited a comment on Bug JENKINS-42340
and how would you define an _input_ step which can wait for say 2 days?

also I think together with JENKINS-42338 this means I have to duplicate the same configuration over and over again. Because I have to define _agent none_ on top scope and redefeine every agent for each _stage_ again.

andrew.bayer@gmail.com (JIRA)

unread,
Feb 27, 2017, 2:37:01 PM2/27/17
to jenkinsc...@googlegroups.com

...yeah, so we don't have a good answer on the waiting-for-2-days input step for sure. I need to do more experiments to see if I can find a way to "escape" from the executor for some other stuff too, but haven't yet found a way. In re JENKINS-42338, that is a good point and is why I'm thinking about that ticket and whether it may make sense to have tools apply for all stages if defined at the top level.

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:24:40 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Won't Fix
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages