SOLR-3892: Inconsistent locking when accessing cache in CachingDirectoryFactory from RAMDirectoryFactory and MockDirectoryFactory.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1390207 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-09-25 23:02:14 +00:00
parent ea85a78ced
commit d503f4a31f
3 changed files with 5 additions and 2 deletions

View File

@ -373,6 +373,9 @@ Bug Fixes
* SOLR-3891: CacheValue in CachingDirectoryFactory cannot be used outside of
solr.core package. (phunt via Mark Miller)
* SOLR-3892: Inconsistent locking when accessing cache in CachingDirectoryFactory
from RAMDirectoryFactory and MockDirectoryFactory. (phunt via Mark Miller)
Other Changes
----------------------

View File

@ -36,7 +36,7 @@ public class RAMDirectoryFactory extends StandardDirectoryFactory {
@Override
public boolean exists(String path) {
String fullPath = new File(path).getAbsolutePath();
synchronized (DirectoryFactory.class) {
synchronized (this) {
CacheValue cacheValue = byPathCache.get(fullPath);
Directory directory = null;
if (cacheValue != null) {

View File

@ -47,7 +47,7 @@ public class MockDirectoryFactory extends CachingDirectoryFactory {
@Override
public boolean exists(String path) {
String fullPath = new File(path).getAbsolutePath();
synchronized (DirectoryFactory.class) {
synchronized (this) {
CacheValue cacheValue = byPathCache.get(fullPath);
Directory directory = null;
if (cacheValue != null) {