[ 
https://issues.apache.org/jira/browse/LUCENE-2520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883803#action_12883803
 ] 

Uwe Schindler commented on LUCENE-2520:
---------------------------------------

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.

> Unsafe synchronization in CachingWrapperFilterHelper
> ----------------------------------------------------
>
>                 Key: LUCENE-2520
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2520
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 3.0.1
>            Reporter: Wendy Feng
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> CachingWrapperFilterHelper has unsaft synchronization as follow:
>  public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
>     if (cache == null) {
>       cache = new WeakHashMap();
>     }
>     
>     synchronized (cache) {  
>        ...
>      }
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to