only log async refresh / merge failure if the engine is not closed

This commit is contained in:
Shay Banon 2011-09-03 20:24:55 +03:00
parent ed99a51406
commit bcd7d97c58
1 changed files with 12 additions and 4 deletions

View File

@ -659,11 +659,15 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I
} else if (e.getCause() instanceof ThreadInterruptedException) { } else if (e.getCause() instanceof ThreadInterruptedException) {
// ignore, we are being shutdown // ignore, we are being shutdown
} else { } else {
if (state != IndexShardState.CLOSED) {
logger.warn("Failed to perform scheduled engine refresh", e); logger.warn("Failed to perform scheduled engine refresh", e);
} }
}
} catch (Exception e) { } catch (Exception e) {
if (state != IndexShardState.CLOSED) {
logger.warn("Failed to perform scheduled engine refresh", e); logger.warn("Failed to perform scheduled engine refresh", e);
} }
}
synchronized (mutex) { synchronized (mutex) {
if (state != IndexShardState.CLOSED) { if (state != IndexShardState.CLOSED) {
refreshScheduledFuture = threadPool.schedule(refreshInterval, ThreadPool.Names.SAME, EngineRefresher.this); refreshScheduledFuture = threadPool.schedule(refreshInterval, ThreadPool.Names.SAME, EngineRefresher.this);
@ -700,11 +704,15 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I
} else if (e.getCause() instanceof ThreadInterruptedException) { } else if (e.getCause() instanceof ThreadInterruptedException) {
// ignore, we are being shutdown // ignore, we are being shutdown
} else { } else {
if (state != IndexShardState.CLOSED) {
logger.warn("Failed to perform scheduled engine optimize/merge", e); logger.warn("Failed to perform scheduled engine optimize/merge", e);
} }
}
} catch (Exception e) { } catch (Exception e) {
if (state != IndexShardState.CLOSED) {
logger.warn("Failed to perform scheduled engine optimize/merge", e); logger.warn("Failed to perform scheduled engine optimize/merge", e);
} }
}
synchronized (mutex) { synchronized (mutex) {
if (state != IndexShardState.CLOSED) { if (state != IndexShardState.CLOSED) {
mergeScheduleFuture = threadPool.schedule(mergeInterval, ThreadPool.Names.SAME, EngineMerger.this); mergeScheduleFuture = threadPool.schedule(mergeInterval, ThreadPool.Names.SAME, EngineMerger.this);