From 3afb5ca1330b96046af3b509ab05e69b64b63fee Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Wed, 19 Feb 2020 16:07:15 +0100 Subject: [PATCH] Fix synchronization in ByteSizeCachingDirectory (#52512) One particular code place was synchronizing on the wrong object. --- .../org/elasticsearch/index/store/ByteSizeCachingDirectory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/index/store/ByteSizeCachingDirectory.java b/server/src/main/java/org/elasticsearch/index/store/ByteSizeCachingDirectory.java index 9a202a9b4cd..eb14d3047a6 100644 --- a/server/src/main/java/org/elasticsearch/index/store/ByteSizeCachingDirectory.java +++ b/server/src/main/java/org/elasticsearch/index/store/ByteSizeCachingDirectory.java @@ -161,7 +161,7 @@ final class ByteSizeCachingDirectory extends FilterDirectory { try { super.close(); } finally { - synchronized (this) { + synchronized (ByteSizeCachingDirectory.this) { numOpenOutputs--; modCount++; }