From 0c08d796c5bf32991b32cead4b594b4e6198d183 Mon Sep 17 00:00:00 2001 From: Britta Weber Date: Wed, 13 Jan 2016 16:27:26 +0100 Subject: [PATCH] assert before we set the suppressed --- .../main/java/org/elasticsearch/index/translog/Translog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/index/translog/Translog.java b/core/src/main/java/org/elasticsearch/index/translog/Translog.java index fdf39a86515..0001fda0752 100644 --- a/core/src/main/java/org/elasticsearch/index/translog/Translog.java +++ b/core/src/main/java/org/elasticsearch/index/translog/Translog.java @@ -580,8 +580,8 @@ public class Translog extends AbstractIndexShardComponent implements IndexShardC // 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) { - ex.addSuppressed(inner); assert (ex != inner.getCause()); + ex.addSuppressed(inner); } } }