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

if an Exception is thrown in a RestartListener Jenkins is left in a zombie state

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • 2.320,2.319.1

      https://github.com/jenkinsci/jenkins/blob/b9cc9174789036f8049d316898aa76043cdc76df/core/src/main/java/jenkins/model/Jenkins.java#L4466-L4468

      if the RestartListener throws an expcetion then Jenkins never actually calls `lifecycle.restart` and the main app is in a "jenkins is restarting" mode so becomes a zombie.

      https://github.com/jenkinsci/acceptance-test-harness/pull/706#issuecomment-953869658

      master61454|2021-10-28 10:21:52.912+0000 [id=149]	INFO	jenkins.model.Jenkins$19#run: Restarting VM as requested by anonymous
      master61454|2021-10-28 10:21:52.927+0000 [id=149]	SEVERE	h.i.i.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler#uncaughtException: A thread (restart thread/149) died unexpectedly due to an uncaught exception, this may leave your Jenkins in a bad way and is usually indicative of a bug in the code.
      master61454|java.lang.NullPointerException
      master61454|	at org.jenkinsci.plugins.mailwatcher.MailWatcherMailer.send(MailWatcherMailer.java:116)
      master61454|	at org.jenkinsci.plugins.mailwatcher.MailWatcherNotification.send(MailWatcherNotification.java:156)
      master61454|	at org.jenkinsci.plugins.mailwatcher.WatcherComputerListener$Notification$Builder.send(WatcherComputerListener.java:181)
      master61454|	at org.jenkinsci.plugins.mailwatcher.WatcherComputerListener.onOffline(WatcherComputerListener.java:91)
      master61454|	at jenkins.model.Jenkins$MasterRestartNotifyier.onRestart(Jenkins.java:4526)
      master61454|	at jenkins.model.Jenkins$19.run(Jenkins.java:4467)
      ... no more logs 
      

       

          [JENKINS-67002] if an Exception is thrown in a RestartListener Jenkins is left in a zombie state

          James Nord created issue -
          James Nord made changes -
          Assignee New: James Nord [ teilo ]
          James Nord made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          James Nord made changes -
          Description Original: [https://github.com/jenkinsci/jenkins/blob/b9cc9174789036f8049d316898aa76043cdc76df/core/src/main/java/jenkins/model/Jenkins.java#L4466-L4468]

          if the RestartListener throws an expcetion then Jenkins never actually calls `lifecycle.restart` and the main app is in a "jenkins is restarting" mode so becomes a zombie.

          https://github.com/jenkinsci/acceptance-test-harness/pull/706#issuecomment-953869658
          New: [https://github.com/jenkinsci/jenkins/blob/b9cc9174789036f8049d316898aa76043cdc76df/core/src/main/java/jenkins/model/Jenkins.java#L4466-L4468]

          if the RestartListener throws an expcetion then Jenkins never actually calls `lifecycle.restart` and the main app is in a "jenkins is restarting" mode so becomes a zombie.

          [https://github.com/jenkinsci/acceptance-test-harness/pull/706#issuecomment-953869658|https://github.com/jenkinsci/acceptance-test-harness/pull/706#issuecomment-953869658]

          {code}
          master61454|2021-10-28 10:21:52.912+0000 [id=149] INFO jenkins.model.Jenkins$19#run: Restarting VM as requested by anonymous
          master61454|2021-10-28 10:21:52.927+0000 [id=149] SEVERE h.i.i.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler#uncaughtException: A thread (restart thread/149) died unexpectedly due to an uncaught exception, this may leave your Jenkins in a bad way and is usually indicative of a bug in the code.
          master61454|java.lang.NullPointerException
          master61454| at org.jenkinsci.plugins.mailwatcher.MailWatcherMailer.send(MailWatcherMailer.java:116)
          master61454| at org.jenkinsci.plugins.mailwatcher.MailWatcherNotification.send(MailWatcherNotification.java:156)
          master61454| at org.jenkinsci.plugins.mailwatcher.WatcherComputerListener$Notification$Builder.send(WatcherComputerListener.java:181)
          master61454| at org.jenkinsci.plugins.mailwatcher.WatcherComputerListener.onOffline(WatcherComputerListener.java:91)
          master61454| at jenkins.model.Jenkins$MasterRestartNotifyier.onRestart(Jenkins.java:4526)
          master61454| at jenkins.model.Jenkins$19.run(Jenkins.java:4467)
          ... no more logs
          {code}

           
          Mark Waite made changes -
          Released As New: 2.320
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Closed [ 6 ]
          Cathy made changes -
          Labels Original: lts-candidate New: 2.319-fixed lts-candidate
          Cathy made changes -
          Labels Original: 2.319-fixed lts-candidate New: 2.319-fixed
          Daniel Beck made changes -
          Labels Original: 2.319-fixed New: 2.319.1-fixed
          James Nord made changes -
          Remote Link New: This issue links to "core PR#5864 (Web Link)" [ 27252 ]
          Cathy made changes -
          Released As Original: 2.320 New: 2.320,2.319.1

            teilo James Nord
            teilo James Nord
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: