From 37baba0f1844e0447e16fc2237caad1193941f4d Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Sat, 8 Nov 2014 05:49:20 -0500 Subject: [PATCH] Core: add debug logging to InternalEngine.close --- .../index/engine/internal/InternalEngine.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java b/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java index 4bf11552c19..8ff4a4254d8 100644 --- a/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java +++ b/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java @@ -1314,12 +1314,14 @@ public class InternalEngine extends AbstractIndexShardComponent implements Engin @Override public void close() throws ElasticsearchException { try (InternalLock _ = writeLock.acquire()) { + logger.debug("close acquired writeLock"); if (!closed) { try { closed = true; indexSettingsService.removeListener(applySettings); this.versionMap.clear(); this.failedEngineListeners.clear(); + logger.debug("close searcherManager"); try { IOUtils.close(searcherManager); } catch (Throwable t) { @@ -1327,16 +1329,13 @@ public class InternalEngine extends AbstractIndexShardComponent implements Engin } // no need to commit in this case!, we snapshot before we close the shard, so translog and all sync'ed if (indexWriter != null) { - long t0 = System.nanoTime(); + logger.debug("rollback indexWriter"); try { indexWriter.rollback(); } catch (AlreadyClosedException e) { // ignore } - long t1 = System.nanoTime(); - if (logger.isDebugEnabled()) { - logger.debug("indexWriter.rollback took {} nanoseconds", t1-t0); - } + logger.debug("rollback indexWriter done"); } } catch (Throwable e) { logger.warn("failed to rollback writer on close", e);