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

Way to mark an Executable that should not block isReadyToRestart

    Details

    • Similar Issues:

      Description

      If you have a Queue.Executable that should consume an executor (so is not from a FlyweightTask), it unconditionally blocks "safe restart": RestartListener.Default merely checks for the existence of at least one busy executor. For an executable using the durable-task plugin or similar, this is undesirable, since the task can in fact survive a Jenkins restart. There should be a way to mark an Executable (or its parent Task) as not blocking restart.

      There is already NonBlockingTask but this controls whether the task can be scheduled while Jenkins is quieting down, while this issue pertains to tasks which are already running and are safe to interrupt.

      As an aside, Jenkins.doSafeExit inexplicably has its own copy of safe shutdown code which neglects to use doQuietDown(true, 0) like doSafeRestart does, and thus does not consider RestartListener.

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Labels api api workflow
            jglick Jesse Glick made changes -
            Remote Link This issue links to "Workflow Trello card (Web Link)" [ 11700 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "Workflow Trello card (Web Link)" [ 11700 ]
            Hide
            jglick Jesse Glick added a comment -

            Also would like an API allowing the flyweight WorkflowRun executable to block a restart while in the middle of a CPS native method. This is especially important for a potentially slow operation like ArtifactArchiver.perform which cannot be stopped partway through. When Jenkins goes into quiet mode, new CPS-transformed calls should not start (so the program counter should pause), and any native methods currently running should be allowed to run to completion before shutdown occurs. This API could be very similar to the one above; essentially a way of customizing the logic of what constitutes a “running executable”.

            Show
            jglick Jesse Glick added a comment - Also would like an API allowing the flyweight WorkflowRun executable to block a restart while in the middle of a CPS native method. This is especially important for a potentially slow operation like ArtifactArchiver.perform which cannot be stopped partway through. When Jenkins goes into quiet mode, new CPS-transformed calls should not start (so the program counter should pause), and any native methods currently running should be allowed to run to completion before shutdown occurs. This API could be very similar to the one above; essentially a way of customizing the logic of what constitutes a “running executable”.
            Hide
            jglick Jesse Glick added a comment -

            JENKINS-25938 also requires an API extension to Executable.

            Show
            jglick Jesse Glick added a comment - JENKINS-25938 also requires an API extension to Executable .
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-25938 [ JENKINS-25938 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-26900 [ JENKINS-26900 ]
            jglick Jesse Glick made changes -
            Assignee Jesse Glick [ jglick ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 1610 (Web Link)" [ 12177 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/src/main/java/hudson/model/Executor.java
            core/src/main/java/hudson/model/RestartListener.java
            core/src/main/java/jenkins/model/Jenkins.java
            core/src/main/java/jenkins/model/queue/AsynchronousExecution.java
            http://jenkins-ci.org/commit/jenkins/8589b211f9a99fa47d022a77bd7936636175898a
            Log:
            [FIXED JENKINS-22941] AsynchronousExecution.blocksRestart

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/Executor.java core/src/main/java/hudson/model/RestartListener.java core/src/main/java/jenkins/model/Jenkins.java core/src/main/java/jenkins/model/queue/AsynchronousExecution.java http://jenkins-ci.org/commit/jenkins/8589b211f9a99fa47d022a77bd7936636175898a Log: [FIXED JENKINS-22941] AsynchronousExecution.blocksRestart
            scm_issue_link SCM/JIRA link daemon made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            jglick Jesse Glick made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            jglick Jesse Glick made changes -
            Status Reopened [ 4 ] Open [ 1 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #4029
            [FIXED JENKINS-22941] AsynchronousExecution.blocksRestart (Revision 8589b211f9a99fa47d022a77bd7936636175898a)

            Result = SUCCESS
            jesse glick : 8589b211f9a99fa47d022a77bd7936636175898a
            Files :

            • core/src/main/java/hudson/model/Executor.java
            • core/src/main/java/jenkins/model/Jenkins.java
            • core/src/main/java/hudson/model/RestartListener.java
            • core/src/main/java/jenkins/model/queue/AsynchronousExecution.java
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #4029 [FIXED JENKINS-22941] AsynchronousExecution.blocksRestart (Revision 8589b211f9a99fa47d022a77bd7936636175898a) Result = SUCCESS jesse glick : 8589b211f9a99fa47d022a77bd7936636175898a Files : core/src/main/java/hudson/model/Executor.java core/src/main/java/jenkins/model/Jenkins.java core/src/main/java/hudson/model/RestartListener.java core/src/main/java/jenkins/model/queue/AsynchronousExecution.java
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: changelog.html http://jenkins-ci.org/commit/jenkins/46dc6850edb1d7ef52592794b15e69db7dfbed1a Log: Noting merges JENKINS-15355 JENKINS-21618 JENKINS-22941 JENKINS-25938 JENKINS-26391 JENKINS-26900 JENKINS-27476 JENKINS-27563 JENKINS-27564 JENKINS-27565 JENKINS-27566 Fixing link text for JENKINS-6167
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
            support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java
            http://jenkins-ci.org/commit/workflow-plugin/285b4501470f321086bcca4f98c871f2d5b6d418
            Log:
            JENKINS-22941 AsynchronousExecution.blocksRestart

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java http://jenkins-ci.org/commit/workflow-plugin/285b4501470f321086bcca4f98c871f2d5b6d418 Log: JENKINS-22941 AsynchronousExecution.blocksRestart
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-32015 [ JENKINS-32015 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
            http://jenkins-ci.org/commit/workflow-job-plugin/40d1c43a2fbe7f76745ed53b6a73539c64d6cedd
            Log:
            JENKINS-22941 AsynchronousExecution.blocksRestart
            Originally-Committed-As: 285b4501470f321086bcca4f98c871f2d5b6d418

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java http://jenkins-ci.org/commit/workflow-job-plugin/40d1c43a2fbe7f76745ed53b6a73539c64d6cedd Log: JENKINS-22941 AsynchronousExecution.blocksRestart Originally-Committed-As: 285b4501470f321086bcca4f98c871f2d5b6d418
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 155088 ] JNJira + In-Review [ 195131 ]
            abayer Andrew Bayer made changes -
            Labels api workflow api pipeline workflow
            abayer Andrew Bayer made changes -
            Labels api pipeline workflow api pipeline

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: