[JIRA] (JENKINS-56786) Safe restart is not safe when some jobs are running

0 views
Skip to first unread message

linuxsuren@gmail.com (JIRA)

unread,
Mar 28, 2019, 2:07:15 AM3/28/19
to jenkinsc...@googlegroups.com
Rick updated an issue
 
Jenkins / Bug JENKINS-56786
Safe restart is not safe when some jobs are running
Change By: Rick
I have a sample Jenkinsfile is here:

{code:groovy}
pipeline {
    agent {
        label 'master'
    }
    
    stages{
        stage('df'){
            steps{
                sleep 199999
                echo "df"
            }
        }
    }
}
{code}

I execute the safeRestart once above pipeline was running.

Expected: Jenkins will restart when the job is completed.
Result: Jenkins restart immediately

Jenkins ver. 2.150.3

The
url URL is http://localhost:8080/safeRestart
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

linuxsuren@gmail.com (JIRA)

unread,
Mar 28, 2019, 2:07:16 AM3/28/19
to jenkinsc...@googlegroups.com
Rick created an issue
Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 2019-03-28 06:06
Priority: Blocker Blocker
Reporter: Rick

I have a sample Jenkinsfile is here:

pipeline {
    agent {
        label 'master'
    }
    
    stages{
        stage('df'){
            steps{
                sleep 199999
                echo "df"
            }
        }
    }
}

I execute the safeRestart once above pipeline was running.

Expected: Jenkins will restart when the job is completed.
Result: Jenkins restart immediately

Jenkins ver. 2.150.3

linuxsuren@gmail.com (JIRA)

unread,
Mar 28, 2019, 2:08:01 AM3/28/19
to jenkinsc...@googlegroups.com

o.v.nenashev@gmail.com (JIRA)

unread,
Mar 28, 2019, 3:11:02 AM3/28/19
to jenkinsc...@googlegroups.com
Oleg Nenashev commented on Bug JENKINS-56786
 
Re: Safe restart is not safe when some jobs are running

IMO it not a defect. Pipeline jobs are design to support master restart during execution, and they deliberately do not block the restart.

 

linuxsuren@gmail.com (JIRA)

unread,
Mar 28, 2019, 4:41:03 AM3/28/19
to jenkinsc...@googlegroups.com
Rick commented on Bug JENKINS-56786

Some pipelines may not allow interrupting. Interruption might break something. Also, the pipeline has an option, below:

'Do not allow the pipeline to resume if the master restarts'

In this case, the pipeline is not expected to break.

jamesnswithers@gmail.com (JIRA)

unread,
Apr 8, 2019, 9:07:01 AM4/8/19
to jenkinsc...@googlegroups.com

I agree that this is a defect but either the text describing safe restart is incorrect or the safe restart is.

kutzi@gmx.de (JIRA)

unread,
May 2, 2019, 8:47:03 AM5/2/19
to jenkinsc...@googlegroups.com
kutzi commented on Bug JENKINS-56786

In my experience pipeline jobs often don't survive a master restart. Even though they 'should' I know, but I don't know what we could have done wrong in all of our pipelines so that all of them tend to fail a lot, when restarting master.

At the very least the description of safeRestart is wrong, as James Withers said: `Are you sure you want to restart Jenkins? Jenkins will restart once all running jobs are finished.`
For pipeline jobs it only - if at all - waits for the current stage to finish

linuxsuren@gmail.com (JIRA)

unread,
May 2, 2019, 9:01:02 AM5/2/19
to jenkinsc...@googlegroups.com
Rick commented on Bug JENKINS-56786

For some situations, a pipeline job is an atom unit. And a stage is just a part of the pipeline job. I still think that the restart action should wait the whole pipeline job is finished. Or leave an option for that at least.

jeet.choudhary7@gmail.com (JIRA)

unread,
Jul 11, 2019, 12:49:02 PM7/11/19
to jenkinsc...@googlegroups.com

jeet.choudhary7@gmail.com (JIRA)

unread,
Jul 11, 2019, 12:50:03 PM7/11/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages