SOLR-11440: Not a fix. Swallowing the exception for the time being.

This commit is contained in:
Noble Paul 2017-10-05 16:34:13 +10:30
parent 080232f3d1
commit 6b327fa404
1 changed files with 13 additions and 1 deletions

View File

@ -37,6 +37,7 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -146,7 +147,18 @@ public class ScheduledTriggers implements Closeable {
if (isClosed) { if (isClosed) {
throw new AlreadyClosedException("ScheduledTriggers has been closed and cannot be used anymore"); throw new AlreadyClosedException("ScheduledTriggers has been closed and cannot be used anymore");
} }
ScheduledTrigger scheduledTrigger = new ScheduledTrigger(newTrigger, zkClient, queueStats); ScheduledTrigger st = null;
try {
st = new ScheduledTrigger(newTrigger, zkClient, queueStats);
} catch (Exception e) {
//TODO to decide what to do
log.error("Failed to add trigger", e);
return;
}
ScheduledTrigger scheduledTrigger = st;
ScheduledTrigger old = scheduledTriggers.putIfAbsent(newTrigger.getName(), scheduledTrigger); ScheduledTrigger old = scheduledTriggers.putIfAbsent(newTrigger.getName(), scheduledTrigger);
if (old != null) { if (old != null) {
if (old.trigger.equals(newTrigger)) { if (old.trigger.equals(newTrigger)) {