diff --git a/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java index f6ac3ef2c92..d20992d4f25 100644 --- a/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java +++ b/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java @@ -150,9 +150,8 @@ public abstract class CachingDirectoryFactory extends DirectoryFactory { private void close(Directory directory) throws IOException { synchronized (this) { - if (closed) { - throw new RuntimeException("Already closed"); - } + // don't check if already closed here - we need to able to release + // while #close() waits. CacheValue cacheValue = byDirectoryCache.get(directory); if (cacheValue == null) {