mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Fix ChronicleMap leak through Closeable in ChronicleMapBuilder.establishCleanupThread()
This commit is contained in:
@@ -1814,11 +1814,12 @@ public final class ChronicleMapBuilder<K, V> implements
|
||||
// WARNING this relies on the fact that ReplicatedChronicleMap closes closeables in the same
|
||||
// order as they are added, i. e. OldDeletedEntriesCleanupThread instance close()d before
|
||||
// the following closeable
|
||||
String mapIdentityString = map.toIdentityString();
|
||||
map.addCloseable(() -> {
|
||||
try {
|
||||
cleanupThread.join();
|
||||
} catch (InterruptedException e) {
|
||||
LOG.warn(map.toIdentityString() +
|
||||
LOG.warn(mapIdentityString +
|
||||
": Interrupted while waiting for the cleanup thread to cease");
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user