Open asfimport opened 14 years ago
Uwe Schindler (@uschindler) (migrated from JIRA)
We discussed several times about that, this is not a problem here, as its a cache and there is no guarantee needed that every object only exists one time. For speed issues in this filter we decided to keep it like that. There are other places in Lucene using caches working the same way.
CachingWrapperFilterHelper has unsaft synchronization as follow:
public DocIdSet getDocIdSet(IndexReader reader) throws IOException { if (cache == null) { cache = new WeakHashMap(); }
It is not safe to assgine a new object to cache before synchronizing on. it may results sycnchronize on two different object if the method is called concurrently when cache =null.
Migrated from LUCENE-2520 by Wendy Feng