Преглед изворни кода

Also catch EngineClosedException when pulling translog from potentially closed engine

When we check the engine if a flush is needed we don't catch EngineClosedException today
but the engine is potentially closed already in which case we can simply return false and don't need
to bubble up the exception.
Simon Willnauer пре 10 година
родитељ
комит
c71da4b999
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      core/src/main/java/org/elasticsearch/index/shard/IndexShard.java

+ 1 - 1
core/src/main/java/org/elasticsearch/index/shard/IndexShard.java

@@ -1095,7 +1095,7 @@ public class IndexShard extends AbstractIndexShardComponent implements IndexSett
                 try {
                     Translog translog = engine.getTranslog();
                     return translog.totalOperations() > flushThresholdOperations || translog.sizeInBytes() > flushThresholdSize.bytes();
-                } catch (AlreadyClosedException ex) {
+                } catch (AlreadyClosedException | EngineClosedException ex) {
                     // that's fine we are already close - no need to flush
                 }
             }