CleanUp() call during restart() is now surrounded but try/catch, which allows the restart to continue if the cleanUp() method fails.

This commit is contained in:
atcarmo committed 2016-02-10 12:53:39 +00:00
1 parent 5d4ec31aa5
commit 1c94716002
4 files changed
+37 -10

No files matched your search

+7 -2
View File
@@ -393,8 +393,13 @@ public class WebAppMain implements ServletContextListener {
public void contextDestroyed(ServletContextEvent event) {
terminated = true;
Jenkins instance = Jenkins.getInstance();
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);
}
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"));