Do not swallow exception when relocating
When relocating a shard before changing the state to relocated, we verify that a relocation is a still taking place. Yet, this can throw an exception if the relocation is in fact no longer valid. Sadly, we were swallowing the exception in this situation. This commit allows such an exception to bubble up after safely releasing resources.
This commit is contained in:
parent
1900d9c447
commit
ebdae09df3
|
@ -545,7 +545,12 @@ public class IndexShard extends AbstractIndexShardComponent implements IndicesCl
|
|||
changeState(IndexShardState.RELOCATED, reason);
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
getEngine().seqNoService().releasePrimaryContext();
|
||||
try {
|
||||
getEngine().seqNoService().releasePrimaryContext();
|
||||
} catch (final Exception inner) {
|
||||
e.addSuppressed(inner);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
} catch (TimeoutException e) {
|
||||
|
|
Loading…
Reference in New Issue