Merge pull request #15952 from brwe/fix-cicular-reference-exception

Avoid circular reference in exception
This commit is contained in:
Britta Weber 2016-01-13 16:28:04 +01:00
commit 87f0edbf51
1 changed files with 4 additions and 0 deletions

View File

@ -576,7 +576,11 @@ public class Translog extends AbstractIndexShardComponent implements IndexShardC
if (current.getTragicException() != null) {
try {
close();
} catch (AlreadyClosedException inner) {
// don't do anything in this case. The AlreadyClosedException comes from TranslogWriter and we should not add it as suppressed because
// will contain the Exception ex as cause. See also https://github.com/elastic/elasticsearch/issues/15941
} catch (Exception inner) {
assert (ex != inner.getCause());
ex.addSuppressed(inner);
}
}