Check engine reference for null before flushing
If we close the shard before the engine is started we see a NPE in the logs which is not problematic since the relevant parts are in a finally block. Yet, the NPE is unnecessary and can be confusing.
This commit is contained in:
parent
581bfc74c6
commit
cbead88273
|
@ -761,7 +761,7 @@ public class IndexShard extends AbstractIndexShardComponent {
|
|||
} finally {
|
||||
final Engine engine = this.currentEngineReference.getAndSet(null);
|
||||
try {
|
||||
if (flushEngine && this.flushOnClose) {
|
||||
if (engine != null && flushEngine && this.flushOnClose) {
|
||||
engine.flushAndClose();
|
||||
}
|
||||
} finally { // playing safe here and close the engine even if the above succeeds - close can be called multiple times
|
||||
|
|
Loading…
Reference in New Issue