mirror of https://github.com/apache/lucene.git
SOLR-10996: Log the right listener config on exception and added a null check before init
This commit is contained in:
parent
5e5462e408
commit
5c691d4542
|
@ -417,7 +417,7 @@ public class ScheduledTriggers implements Closeable {
|
|||
try {
|
||||
oldListener.close();
|
||||
} catch (Exception e) {
|
||||
log.warn("Exception closing old listener " + listener.getConfig(), e);
|
||||
log.warn("Exception closing old listener " + oldListener.getConfig(), e);
|
||||
}
|
||||
} else {
|
||||
listener = oldListener; // reuse
|
||||
|
@ -430,19 +430,17 @@ public class ScheduledTriggers implements Closeable {
|
|||
} catch (Exception e) {
|
||||
log.warn("Invalid TriggerListener class name '" + clazz + "', skipping...", e);
|
||||
}
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.init(coreContainer, config);
|
||||
listenersPerName.put(config.name, listener);
|
||||
} catch (Exception e) {
|
||||
log.warn("Error initializing TriggerListener " + config, e);
|
||||
try {
|
||||
listener.close();
|
||||
} catch (Exception e1) {
|
||||
// ignore
|
||||
}
|
||||
IOUtils.closeQuietly(listener);
|
||||
listener = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (listener == null) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue