[prev in list] [next in list] [prev in thread] [next in thread] 

List:       solr-dev
Subject:    [jira] Commented: (LUCENE-2520) Unsafe synchronization in
From:       "Uwe Schindler (JIRA)" <jira () apache ! org>
Date:       2010-06-30 6:23:50
Message-ID: 11961202.128121277879030728.JavaMail.jira () thor
[Download RAW message or body]


    [ 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic