Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-30565

Jenkins should ask for confirmation before aborting a build

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      Jenkins does not ask for confirmation before aborting a build. Since this can cause significant harm in the case of long-running builds or builds with side effects (partial deployments etc.), this should be added to the abort functionality.

      Queued items can be parameterized or triggered in a way that makes them difficult to reproduce (actions added etc.) so those should probably be protected from accidentally canceling them as well.

        Attachments

          Issue Links

            Activity

            Hide
            integer Kanstantsin Shautsou added a comment -

            Probably the main issue that in highly active queue UI can send abort to wrong running job because of refresh rendering.

            Show
            integer Kanstantsin Shautsou added a comment - Probably the main issue that in highly active queue UI can send abort to wrong running job because of refresh rendering.
            Hide
            danielbeck Daniel Beck added a comment -

            True. Another reason for having this. That was actually the reason I went the extra inch and added the job name for queue items, and job name and build name for running builds, rather than just asking "Are you sure you want to abort?".

            Show
            danielbeck Daniel Beck added a comment - True. Another reason for having this. That was actually the reason I went the extra inch and added the job name for queue items, and job name and build name for running builds, rather than just asking "Are you sure you want to abort?".
            Hide
            integer Kanstantsin Shautsou added a comment -

            Side effect is that if i mistakenly run build i want abort it very fast. And now i can do it.

            Show
            integer Kanstantsin Shautsou added a comment - Side effect is that if i mistakenly run build i want abort it very fast. And now i can do it.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Daniel Beck
            Path:
            core/src/main/resources/hudson/widgets/BuildHistoryWidget/entries.properties
            core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly
            core/src/main/resources/hudson/widgets/HistoryWidget/entry.properties
            core/src/main/resources/lib/hudson/buildCaption.jelly
            core/src/main/resources/lib/hudson/buildCaption.properties
            core/src/main/resources/lib/hudson/executors.jelly
            core/src/main/resources/lib/hudson/executors.properties
            core/src/main/resources/lib/hudson/queue.jelly
            core/src/main/resources/lib/hudson/queue.properties
            core/src/main/resources/lib/layout/stopButton.jelly
            http://jenkins-ci.org/commit/jenkins/3af3a27116ccec048ce9eb61f947d74e0fe37611
            Log:
            [FIX JENKINS-30565] Ask for confirmation before canceling/aborting (#1835)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/resources/hudson/widgets/BuildHistoryWidget/entries.properties core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly core/src/main/resources/hudson/widgets/HistoryWidget/entry.properties core/src/main/resources/lib/hudson/buildCaption.jelly core/src/main/resources/lib/hudson/buildCaption.properties core/src/main/resources/lib/hudson/executors.jelly core/src/main/resources/lib/hudson/executors.properties core/src/main/resources/lib/hudson/queue.jelly core/src/main/resources/lib/hudson/queue.properties core/src/main/resources/lib/layout/stopButton.jelly http://jenkins-ci.org/commit/jenkins/3af3a27116ccec048ce9eb61f947d74e0fe37611 Log: [FIX JENKINS-30565] Ask for confirmation before canceling/aborting (#1835)
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            The fix has been released in 2.21

            Show
            oleg_nenashev Oleg Nenashev added a comment - The fix has been released in 2.21
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Daniel Beck Is it something we want to have in 2.19.x LTS?

            Show
            oleg_nenashev Oleg Nenashev added a comment - Daniel Beck Is it something we want to have in 2.19.x LTS?
            Hide
            splashnenen Alexandre Aubert added a comment -

            HI,
            After installing Jenkins 2.21, we indeed have a confirmation message before canceling running job or deleting job from queue but when we check the box 'don't display this kind of message anymore' the message well doesn't display anymore but job cancelation has no effect.

            Job is well canceled or removed form queue only when we click on the confirmation message.
            Could you have a look on that please ?
            Thx

            Show
            splashnenen Alexandre Aubert added a comment - HI, After installing Jenkins 2.21, we indeed have a confirmation message before canceling running job or deleting job from queue but when we check the box 'don't display this kind of message anymore' the message well doesn't display anymore but job cancelation has no effect. Job is well canceled or removed form queue only when we click on the confirmation message. Could you have a look on that please ? Thx
            Hide
            danielbeck Daniel Beck added a comment -

            'don't display this kind of message anymore' the message well doesn't display anymore but job cancelation has no effect.

            Don't do that then. It's a browser feature designed to prevent popup spam. It won't magically remember your previous answer.

            Oleg Nenashev No, not a backportable fix.

            Show
            danielbeck Daniel Beck added a comment - 'don't display this kind of message anymore' the message well doesn't display anymore but job cancelation has no effect. Don't do that then. It's a browser feature designed to prevent popup spam. It won't magically remember your previous answer. Oleg Nenashev No, not a backportable fix.
            Hide
            ssides steve sides added a comment -

            "the message well doesn't display anymore but job cancelation has no effect" hmmm...maybe you missed this point of the comment.
            What I am currently looking at, I click the red x abort job button, a dialog comes up; I dismiss it; I click the red x again; another dialog comes up; I check that box and click ok. However, the job is not cancelled. Jenkins is still hung. The job cancellation has no effect and the jenkins ui is stuck, and the job will not be cancelled. I have to delete the job and/or restart jenkins. This is halfway through a pipeline job using 2.26.

            Show
            ssides steve sides added a comment - "the message well doesn't display anymore but job cancelation has no effect" hmmm...maybe you missed this point of the comment. What I am currently looking at, I click the red x abort job button, a dialog comes up; I dismiss it; I click the red x again; another dialog comes up; I check that box and click ok. However, the job is not cancelled. Jenkins is still hung. The job cancellation has no effect and the jenkins ui is stuck, and the job will not be cancelled. I have to delete the job and/or restart jenkins. This is halfway through a pipeline job using 2.26.
            Hide
            danielbeck Daniel Beck added a comment -

            "the message well doesn't display anymore but job cancelation has no effect" hmmm...maybe you missed this point of the comment.

            I did not. You told your browser "From now on, automatically reject all popup messages from this site", and that's what happens. Jenkins asks for confirmation, your browser tells it "No", and nothing gets cancelled. Remember, your computer does what you tell it to do, not what you want

            The job cancellation has no effect and the jenkins ui is stuck, and the job will not be cancelled. I have to delete the job and/or restart jenkins.

            Or, you know, restart your browser to clear the flag you accidentally set.

            Show
            danielbeck Daniel Beck added a comment - "the message well doesn't display anymore but job cancelation has no effect" hmmm...maybe you missed this point of the comment. I did not. You told your browser "From now on, automatically reject all popup messages from this site", and that's what happens. Jenkins asks for confirmation, your browser tells it "No", and nothing gets cancelled. Remember, your computer does what you tell it to do, not what you want The job cancellation has no effect and the jenkins ui is stuck, and the job will not be cancelled. I have to delete the job and/or restart jenkins. Or, you know, restart your browser to clear the flag you accidentally set.
            Hide
            paulca Paul Carr added a comment -

            This should be feature switchable .... we have hundreds of automated tests that will eventually fail if a server is down. Once we know they're all going to fail we now have to click the popup to cancel each. Could we have an option in the Manage Jenkins menu to disable these popups ?

            Show
            paulca Paul Carr added a comment - This should be feature switchable .... we have hundreds of automated tests that will eventually fail if a server is down. Once we know they're all going to fail we now have to click the popup to cancel each. Could we have an option in the Manage Jenkins menu to disable these popups ?
            Hide
            paulca Paul Carr added a comment -

            This should really be switchable in the jenkins config

            Show
            paulca Paul Carr added a comment - This should really be switchable in the jenkins config
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            > Could we have an option in the Manage Jenkins menu to disable these popups ?

            Likely it lies within the "feel free to contribute". If you have hundreds of tests, the best solution is to write a system Groovy script for it

            Show
            oleg_nenashev Oleg Nenashev added a comment - > Could we have an option in the Manage Jenkins menu to disable these popups ? Likely it lies within the "feel free to contribute". If you have hundreds of tests, the best solution is to write a system Groovy script for it
            Hide
            paulca Paul Carr added a comment -

            Wouldn't that make upgrading more painful ? Having to remember to copy the groovy script etc ?  This was a feature requested by 1 person, with 2 additional votes, and it's made it straight into the main build. I suspect more people than just me will find it infuriating when they eventually upgrade.

            Show
            paulca Paul Carr added a comment - Wouldn't that make upgrading more painful ? Having to remember to copy the groovy script etc ?  This was a feature requested by 1 person, with 2 additional votes, and it's made it straight into the main build. I suspect more people than just me will find it infuriating when they eventually upgrade.
            Hide
            danielbeck Daniel Beck added a comment -

            This is resolved, anything else is a followup RFE.

            Show
            danielbeck Daniel Beck added a comment - This is resolved, anything else is a followup RFE.
            Hide
            paulca Paul Carr added a comment -

            OK.

            Show
            paulca Paul Carr added a comment - OK.
            Hide
            ewalt72 Eric Waltersdorf added a comment -

            Requiring all cancelled jobs to be acknowledge is ridiculous without being able to turn it off as a configuration setting.  I regularly have to cancel lots of running jobs. 

            Please add a configuration setting or pull this back.

            Show
            ewalt72 Eric Waltersdorf added a comment - Requiring all cancelled jobs to be acknowledge is ridiculous without being able to turn it off as a configuration setting.  I regularly have to cancel lots of running jobs.  Please add a configuration setting or pull this back.
            Hide
            danielbeck Daniel Beck added a comment -

            Eric Waltersdorf Again,

            This is resolved, anything else is a followup RFE.

            Please file that, and link it from here, if you feel something like that is necessary. Also, provide your use case. From my POV "I regularly have dozens or hundreds of builds in the queue and need to cancel them quickly" rather indicates a much different underlying problem to me. Stack Overflow calls this the "X/Y problem", maybe an entirely different solution would be more practical.

            Show
            danielbeck Daniel Beck added a comment - Eric Waltersdorf Again, This is resolved, anything else is a followup RFE. Please file that, and link it from here, if you feel something like that is necessary. Also, provide your use case. From my POV "I regularly have dozens or hundreds of builds in the queue and need to cancel them quickly" rather indicates a much different underlying problem to me. Stack Overflow calls this the "X/Y problem", maybe an entirely different solution would be more practical.
            Hide
            oleg_nenashev Oleg Nenashev added a comment - - edited

            If somebody wants to disable this feature, it is pretty trivial to do so by adding a SystemProperty to Jenkins. By default Jenkins should require confirmation IMHO

            Show
            oleg_nenashev Oleg Nenashev added a comment - - edited If somebody wants to disable this feature, it is pretty trivial to do so by adding a SystemProperty to Jenkins. By default Jenkins should require confirmation IMHO
            Hide
            danielbeck Daniel Beck added a comment -

            pretty trivial to do so

            Let's please not add new options without having determined whether there's an actual need for it. See my preceding comment.

            Show
            danielbeck Daniel Beck added a comment - pretty trivial to do so Let's please not add new options without having determined whether there's an actual need for it. See my preceding comment.

              People

              • Assignee:
                danielbeck Daniel Beck
                Reporter:
                danielbeck Daniel Beck
              • Votes:
                3 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: