mirror of https://github.com/apache/lucene.git
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:
parent
ea85a78ced
commit
d503f4a31f
|
@ -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
|
||||
----------------------
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue