Merge branch 'JENKINS-32820' of https://github.com/atcarmo/jenkins into bug/JENKINS-32820

Conflicts:
	core/src/main/java/hudson/WebAppMain.java
	core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java
	core/src/main/java/hudson/lifecycle/UnixLifecycle.java
This commit is contained in:
Oleg Nenashev committed 2017-02-12 13:50:52 +03:00
commit 579a88d6e7
4 files changed
+40 -7

No files matched your search

+9 -3
View File
@@ -375,10 +375,16 @@ public class WebAppMain implements ServletContextListener {
public void contextDestroyed(ServletContextEvent event) {
try (ACLContext old = ACL.as(ACL.SYSTEM)) {
terminated = true;
Jenkins instance = Jenkins.getInstanceOrNull();
if (instance != null)
instance.cleanUp();
try {
if (instance != null) {
instance.cleanUp();
}
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "Failed to clean up. Restart will continue.", e);
}
terminated = true;
Thread t = initThread;
if (t != null && t.isAlive()) {
LOGGER.log(Level.INFO, "Shutting down a Jenkins instance that was still starting up", new Throwable("reason"));