Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-Dev

[jira] Updated: (LUCENE-2030) CachingSpanFilter synchronizing on a none final protected object

 

 

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded


jira at apache

Nov 4, 2009, 9:09 AM

Post #1 of 5 (316 views)
Permalink
[jira] Updated: (LUCENE-2030) CachingSpanFilter synchronizing on a none final protected object

[ https://issues.apache.org/jira/browse/LUCENE-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon Willnauer updated LUCENE-2030:
------------------------------------

Attachment: LUCENE-2030.patch

> CachingSpanFilter synchronizing on a none final protected object
> ----------------------------------------------------------------
>
> Key: LUCENE-2030
> URL: https://issues.apache.org/jira/browse/LUCENE-2030
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Search
> Affects Versions: 2.9
> Reporter: Simon Willnauer
> Priority: Minor
> Fix For: 3.1
>
> Attachments: LUCENE-2030.patch
>
>
> CachingSpanFilter and CachingWrapperFilter expose their internal cache via a protected member which is lazily instantiated in the getDocSetId method. The current code yields the chance to double instantiate the cache and internally synchronizes on a protected none final member. My first guess is that this member was exposed for testing purposes so it should rather be changed to package private.
> This patch breaks backwards compat while I guess the cleanup is kind of worth breaking it.

--
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: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


jira at apache

Nov 4, 2009, 7:22 PM

Post #2 of 5 (290 views)
Permalink
[jira] Updated: (LUCENE-2030) CachingSpanFilter synchronizing on a none final protected object [In reply to]

[ https://issues.apache.org/jira/browse/LUCENE-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated LUCENE-2030:
----------------------------------

Attachment: LUCENE-2030.patch

Fixed patch.

> CachingSpanFilter synchronizing on a none final protected object
> ----------------------------------------------------------------
>
> Key: LUCENE-2030
> URL: https://issues.apache.org/jira/browse/LUCENE-2030
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Search
> Affects Versions: 2.9
> Reporter: Simon Willnauer
> Assignee: Uwe Schindler
> Priority: Minor
> Fix For: 3.1
>
> Attachments: LUCENE-2030.patch, LUCENE-2030.patch
>
>
> CachingSpanFilter and CachingWrapperFilter expose their internal cache via a protected member which is lazily instantiated in the getDocSetId method. The current code yields the chance to double instantiate the cache and internally synchronizes on a protected none final member. My first guess is that this member was exposed for testing purposes so it should rather be changed to package private.
> This patch breaks backwards compat while I guess the cleanup is kind of worth breaking it.

--
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: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


jira at apache

Nov 6, 2009, 2:28 PM

Post #3 of 5 (279 views)
Permalink
[jira] Updated: (LUCENE-2030) CachingSpanFilter synchronizing on a none final protected object [In reply to]

[ https://issues.apache.org/jira/browse/LUCENE-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated LUCENE-2030:
----------------------------------

Attachment: LUCENE-2030.patch

New patch. The previous one had the problem, that it also blocked during creating the Filter/SpanResult. Now it only locks correctly before creating the WeakHashMap at all and when requesting/putting entries. The only problem is, that two threads may create the same DocIdSet at the same time because of cache miss, but that is not a problem at all for correct behaviour.

> CachingSpanFilter synchronizing on a none final protected object
> ----------------------------------------------------------------
>
> Key: LUCENE-2030
> URL: https://issues.apache.org/jira/browse/LUCENE-2030
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Search
> Affects Versions: 2.9
> Reporter: Simon Willnauer
> Assignee: Uwe Schindler
> Priority: Minor
> Fix For: 3.1
>
> Attachments: LUCENE-2030.patch, LUCENE-2030.patch, LUCENE-2030.patch
>
>
> CachingSpanFilter and CachingWrapperFilter expose their internal cache via a protected member which is lazily instantiated in the getDocSetId method. The current code yields the chance to double instantiate the cache and internally synchronizes on a protected none final member. My first guess is that this member was exposed for testing purposes so it should rather be changed to package private.
> This patch breaks backwards compat while I guess the cleanup is kind of worth breaking it.

--
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: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


jira at apache

Nov 8, 2009, 11:07 AM

Post #4 of 5 (269 views)
Permalink
[jira] Updated: (LUCENE-2030) CachingSpanFilter synchronizing on a none final protected object [In reply to]

[ https://issues.apache.org/jira/browse/LUCENE-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated LUCENE-2030:
----------------------------------

Attachment: LUCENE-2030.patch

New patch that uses ReentrantLock from Java5's concurrent package. This lock is serializable. All tests pass, will commit soon.

> CachingSpanFilter synchronizing on a none final protected object
> ----------------------------------------------------------------
>
> Key: LUCENE-2030
> URL: https://issues.apache.org/jira/browse/LUCENE-2030
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Search
> Affects Versions: 2.9
> Reporter: Simon Willnauer
> Assignee: Uwe Schindler
> Priority: Minor
> Fix For: 3.1
>
> Attachments: LUCENE-2030.patch, LUCENE-2030.patch, LUCENE-2030.patch, LUCENE-2030.patch
>
>
> CachingSpanFilter and CachingWrapperFilter expose their internal cache via a protected member which is lazily instantiated in the getDocSetId method. The current code yields the chance to double instantiate the cache and internally synchronizes on a protected none final member. My first guess is that this member was exposed for testing purposes so it should rather be changed to package private.
> This patch breaks backwards compat while I guess the cleanup is kind of worth breaking it.

--
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: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


simon.willnauer at googlemail

Nov 8, 2009, 11:59 AM

Post #5 of 5 (267 views)
Permalink
Re: [jira] Updated: (LUCENE-2030) CachingSpanFilter synchronizing on a none final protected object [In reply to]

Uwe, happy that you found a nice way to do it! Java 5 concurrent is gonna be
use in a whole lot of places I guess.

Simon

On Nov 8, 2009 8:07 PM, "Uwe Schindler (JIRA)" <jira [at] apache> wrote:

[
https://issues.apache.org/jira/browse/LUCENE-2030?page=com.atlassian.jira.plugin.system.issu.
..
New patch that uses ReentrantLock from Java5's concurrent package. This lock
is serializable. All tests pass, will commit soon.

> CachingSpanFilter synchronizing on a none final protected object >
------------------------------...
> Attachments: LUCENE-2030.patch, LUCENE-2030.patch,
LUCENE-2030.patch, LUCENE-2030.patch

> > > CachingSpanFilter and CachingWrapperFilter expose their internal cache
via a protected member ...

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.