Skip to content

Commit

Permalink
[JENKINS-17248] Be robust against exceptions in ItemListener.onLoaded…
Browse files Browse the repository at this point in the history
…, since this could interrupt Jenkins startup.

(cherry picked from commit 4def416)
  • Loading branch information
jglick authored and olivergondza committed Sep 17, 2013
1 parent 20004f8 commit 08c1892
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/main/java/jenkins/model/Jenkins.java
Expand Up @@ -847,7 +847,11 @@ protected void doRun() throws Exception {

for (ItemListener l : ItemListener.all()) {
long itemListenerStart = System.currentTimeMillis();
l.onLoaded();
try {
l.onLoaded();
} catch (RuntimeException x) {
LOGGER.log(Level.WARNING, null, x);
}
if (LOG_STARTUP_PERFORMANCE)
LOGGER.info(String.format("Took %dms for item listener %s startup",
System.currentTimeMillis()-itemListenerStart,l.getClass().getName()));
Expand Down

0 comments on commit 08c1892

Please sign in to comment.