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

Jenkins 2.34x (launched with Docker) does not quit when asking with Manage Jenkins -> Prepare for Shutdown

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • Jenkins 2.347, Docker version 20.10.14, build a224086, Windows 11 Pro 21H2

      Hi,

      When I use the /exit or /safeRestart, everything works as expected.
      When I use the Manage Jenkins -> Prepare for Shutdown, I have the red headband saying Jenkins will shut down, but nothing is shown in the logs, and Jenkins never stops.

      From a fresh installation, you can see the plugins install, and then when I ask for a shutdown, no further log can be seen.

       h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Ant.AntInstaller
      2022-05-11 14:34:52.108+0000 [id=133]   INFO    h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.plugins.gradle.GradleInstaller
      2022-05-11 14:34:52.989+0000 [id=133]   INFO    h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tools.JDKInstaller
      2022-05-11 14:34:53.039+0000 [id=310]   INFO    jenkins.InitReactorRunner$1#onAttained: Started initialization
      2022-05-11 14:34:53.043+0000 [id=319]   INFO    jenkins.InitReactorRunner$1#onAttained: Listed all plugins
      2022-05-11 14:34:53.045+0000 [id=325]   INFO    jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
      2022-05-11 14:34:53.097+0000 [id=334]   INFO    jenkins.InitReactorRunner$1#onAttained: Started all plugins
      2022-05-11 14:34:53.109+0000 [id=341]   INFO    jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
      2022-05-11 14:34:53.114+0000 [id=346]   INFO    jenkins.InitReactorRunner$1#onAttained: System config loaded
      2022-05-11 14:34:53.143+0000 [id=318]   INFO    jenkins.InitReactorRunner$1#onAttained: System config adapted
      2022-05-11 14:34:53.184+0000 [id=330]   INFO    jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
      2022-05-11 14:34:53.185+0000 [id=333]   INFO    jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
      2022-05-11 14:34:53.487+0000 [id=331]   INFO    jenkins.InitReactorRunner$1#onAttained: Completed initialization
      2022-05-11 14:34:53.491+0000 [id=133]   INFO    h.m.UpdateCenter$CompleteBatchJob#run: Completed installation of 83 plugins in 1 min 43 sec 

      Using --rm --restart=always --restart=on-failure makes no difference in behaviour.

       

          [JENKINS-68500] Jenkins 2.34x (launched with Docker) does not quit when asking with Manage Jenkins -> Prepare for Shutdown

          Basil Crow added a comment -

          No plans to investigate this. Pull requests are welcome.

          Basil Crow added a comment - No plans to investigate this. Pull requests are welcome.

          Mark Waite added a comment -

          I think this may be a misunderstanding of the purpose and intent of "Prepare for shutdown". The description of the action on www.jenkins.io says

          Prevents new builds from starting so that the system can be shut down safely.

          I believe the intent of that action is to prevent new builds so that the administrator can choose at a later time to restart the system or stop the system.

          The /safeRestart action is "Prepare for shutdown" followed by "Restart".

          The /restart action is "Restart" without any delay or preparation for the shutdown.

          Mark Waite added a comment - I think this may be a misunderstanding of the purpose and intent of "Prepare for shutdown". The description of the action on www.jenkins.io says Prevents new builds from starting so that the system can be shut down safely. I believe the intent of that action is to prevent new builds so that the administrator can choose at a later time to restart the system or stop the system. The /safeRestart action is "Prepare for shutdown" followed by "Restart". The /restart action is "Restart" without any delay or preparation for the shutdown.

          Bruno Verachten added a comment - - edited

          My bad, Mark, I should have better read the documentation.
          Let's close that issue, sorry for that.

          Maybe I could just add a little something in the documentation linking to the description of /exit, /safeRestart and /restart.

          Bruno Verachten added a comment - - edited My bad, Mark, I should have better read the documentation. Let's close that issue, sorry for that. Maybe I could just add a little something in the documentation linking to the description of /exit , /safeRestart and /restart .

          Basil Crow added a comment -

          There's also a /safeExit although I do not believe we expose it in the UI.

          Basil Crow added a comment - There's also a /safeExit although I do not believe we expose it in the UI.

          Mark Waite added a comment -

          I think it would be great if you added a broader description of "Prepare for shutdown" and mentioned the "/restart" and "/safeRestart" end points.

          When I use the "/exit" endpoint, it tells me that it needs to switch to POST. If others have that same experience, that leads me to think that we should not describe it.

          Mark Waite added a comment - I think it would be great if you added a broader description of "Prepare for shutdown" and mentioned the "/restart" and "/safeRestart" end points. When I use the "/exit" endpoint, it tells me that it needs to switch to POST. If others have that same experience, that leads me to think that we should not describe it.

          Bruno Verachten added a comment - - edited

          I will definitely propose a modification to the documentation

          I am also experimenting the same behaviour with the /exit end point.

          I will have a deeper look at the documentation, but are these end points linked to a button, an action, whatever within the UI?
          Are we supposed to stop/restart Jenkins just by modifying the URL by hand, by a REST API request, or via the command line?
          I'm a command line guy, but sometimes, it's easier to interact with Jenkins via the UI. 
          I guess the "Prepare for Shutdown" can also be done via an end point/REST/command, but... If we initiate it via the UI, why can't we "finish the job" within the UI too?
          Maybe that only makes sense to me.
          Where is the correct place to discuss that? Community?

          Thanks for your feedback

          Bruno Verachten added a comment - - edited I will definitely propose a modification to the documentation I am also experimenting the same behaviour with the /exit end point. I will have a deeper look at the documentation, but are these end points linked to a button, an action, whatever within the UI? Are we supposed to stop/restart Jenkins just by modifying the URL by hand, by a REST API request, or via the command line? I'm a command line guy, but sometimes, it's easier to interact with Jenkins via the UI.  I guess the "Prepare for Shutdown" can also be done via an end point/REST/command, but... If we initiate it via the UI, why can't we "finish the job" within the UI too? Maybe that only makes sense to me. Where is the correct place to discuss that? Community ? Thanks for your feedback

          Basil Crow added a comment -

           Where is the correct place to discuss that?

          Hello Bruno, this is an issue tracker, not a support site. I would recommend you direct your questions about how to use Jenkins to the user list.

          Basil Crow added a comment -  Where is the correct place to discuss that? Hello Bruno, this is an issue tracker, not a support site. I would recommend you direct your questions about how to use Jenkins to the user list .

          Bruno Verachten added a comment - - edited

          Hello Basil,

          this is an issue tracker, not a support site. I would recommend you direct your questions about how to use Jenkins to the user list.

          I'm a total newbie when it comes to Jenkins. Thanks for bearing with me. There are lots of communication channels for Jenkins, I was not asking for help regarding this subject in here; I was just asking for hints about the right place to get some help. Thanks for the link, I found there a reference to a plugin called SafeRestart that does what I was looking for.

          Bruno Verachten added a comment - - edited Hello Basil, this is an issue tracker, not a support site. I would recommend you direct your questions about how to use Jenkins to the user list . I'm a total newbie when it comes to Jenkins. Thanks for bearing with me. There are lots of communication channels for Jenkins, I was not asking for help regarding this subject in here; I was just asking for hints about the right place to get some help. Thanks for the link, I found there a reference to a plugin called SafeRestart that does what I was looking for.

            Unassigned Unassigned
            poddingue Bruno Verachten
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: