diff --git a/core/src/main/java/hudson/WebAppMain.java b/core/src/main/java/hudson/WebAppMain.java index 11d438d5ab..d3375be646 100644 --- a/core/src/main/java/hudson/WebAppMain.java +++ b/core/src/main/java/hudson/WebAppMain.java @@ -396,8 +396,10 @@ public class WebAppMain implements ServletContextListener { if(instance!=null) instance.cleanUp(); Thread t = initThread; - if (t!=null) + if (t != null && t.isAlive()) { + LOGGER.log(Level.INFO, "Shutting down a Jenkins instance that was still starting up", new Throwable("reason")); t.interrupt(); + } // Logger is in the system classloader, so if we don't do this // the whole web app will never be undepoyed.