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 {
|
try {
|
||||||
oldListener.close();
|
oldListener.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("Exception closing old listener " + listener.getConfig(), e);
|
log.warn("Exception closing old listener " + oldListener.getConfig(), e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
listener = oldListener; // reuse
|
listener = oldListener; // reuse
|
||||||
|
@ -430,19 +430,17 @@ public class ScheduledTriggers implements Closeable {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("Invalid TriggerListener class name '" + clazz + "', skipping...", e);
|
log.warn("Invalid TriggerListener class name '" + clazz + "', skipping...", e);
|
||||||
}
|
}
|
||||||
|
if (listener != null) {
|
||||||
try {
|
try {
|
||||||
listener.init(coreContainer, config);
|
listener.init(coreContainer, config);
|
||||||
listenersPerName.put(config.name, listener);
|
listenersPerName.put(config.name, listener);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("Error initializing TriggerListener " + config, e);
|
log.warn("Error initializing TriggerListener " + config, e);
|
||||||
try {
|
IOUtils.closeQuietly(listener);
|
||||||
listener.close();
|
|
||||||
} catch (Exception e1) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
listener = null;
|
listener = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue