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 88e4b06421e0c..fdf39a86515f0 100644 --- a/core/src/main/java/org/elasticsearch/index/translog/Translog.java +++ b/core/src/main/java/org/elasticsearch/index/translog/Translog.java @@ -576,8 +576,12 @@ private void closeOnTragicEvent(Throwable ex) { 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) { ex.addSuppressed(inner); + assert (ex != inner.getCause()); } } }