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

Search Discussions

  • Simon Willnauer (JIRA) at Nov 4, 2009 at 5:09 pm
    [ 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@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Uwe Schindler (JIRA) at Nov 5, 2009 at 3:06 am
    [ https://issues.apache.org/jira/browse/LUCENE-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Uwe Schindler reassigned LUCENE-2030:
    -------------------------------------

    Assignee: Uwe Schindler
    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


    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@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Uwe Schindler (JIRA) at Nov 5, 2009 at 3:06 am
    [ https://issues.apache.org/jira/browse/LUCENE-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773758#action_12773758 ]

    Uwe Schindler commented on LUCENE-2030:
    ---------------------------------------

    This patch breaks serialization because the de-serializer does not call ctors and so the cache keeps unintialized (=null).
    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@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Uwe Schindler (JIRA) at Nov 5, 2009 at 3:22 am
    [ 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@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Simon Willnauer (JIRA) at Nov 5, 2009 at 7:32 am
    [ https://issues.apache.org/jira/browse/LUCENE-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773814#action_12773814 ]

    Simon Willnauer commented on LUCENE-2030:
    -----------------------------------------

    Uwe, I'm so glad that you are so keen on stuff like Java serialization! Thanks
    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@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Uwe Schindler (JIRA) at Nov 6, 2009 at 10:28 pm
    [ 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@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Uwe Schindler (JIRA) at Nov 8, 2009 at 7:07 pm
    [ 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@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Simon Willnauer at Nov 8, 2009 at 8:00 pm
    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)" 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 ...
  • Uwe Schindler (JIRA) at Nov 8, 2009 at 9:47 pm
    [ https://issues.apache.org/jira/browse/LUCENE-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Uwe Schindler resolved LUCENE-2030.
    -----------------------------------

    Resolution: Fixed
    Fix Version/s: (was: 3.1)
    3.0

    Committed revision: 833934
    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.0

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categorieslucene
postedNov 4, '09 at 5:09p
activeNov 8, '09 at 9:47p
posts10
users2
websitelucene.apache.org

People

Translate

site design / logo © 2021 Grokbase