Solr
  1. Solr
  2. SOLR-5019

spurious ConcurrentModificationException with spell check component

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      ConcurrentModificationException with spell check component
      http://markmail.org/message/bynajxhgzi2wyhx5

      1. SOLR-5019.patch
        0.9 kB
        Yonik Seeley

        Activity

        Hide
        Aditya added a comment -

        Some Additional Stack from logs. This exception is also observed around the error.

        2013-06-25 10:52:52,471 WARNING [org.apache.solr.spelling.SpellCheckCollator] (ajp-0.0.0.0-8009-50) Exception trying to re-query to check if a spell check possibility would return any hits.
        java.util.ConcurrentModificationException
        at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
        at java.util.AbstractList$Itr.next(AbstractList.java:343)
        at java.util.AbstractList.equals(AbstractList.java:506)
        at org.apache.solr.search.QueryResultKey.isEqual(QueryResultKey.java:96)
        at org.apache.solr.search.QueryResultKey.equals(QueryResultKey.java:81)
        at java.util.HashMap.put(HashMap.java:376)
        at org.apache.solr.search.LRUCache.put(LRUCache.java:123)
        at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1377)
        at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:457)
        at org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:410)
        at org.apache.solr.spelling.SpellCheckCollator.collate(SpellCheckCollator.java:112)
        at org.apache.solr.handler.component.SpellCheckComponent.addCollationsToResponse(SpellCheckComponent.java:203)
        at org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:180)
        at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:208)
        at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
        at org.apache.solr.core.SolrCore.execute(SolrCore.java:1817)
        at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:639)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:345)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:141)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)
        at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:662)

        Show
        Aditya added a comment - Some Additional Stack from logs. This exception is also observed around the error. 2013-06-25 10:52:52,471 WARNING [org.apache.solr.spelling.SpellCheckCollator] (ajp-0.0.0.0-8009-50) Exception trying to re-query to check if a spell check possibility would return any hits. java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) at java.util.AbstractList$Itr.next(AbstractList.java:343) at java.util.AbstractList.equals(AbstractList.java:506) at org.apache.solr.search.QueryResultKey.isEqual(QueryResultKey.java:96) at org.apache.solr.search.QueryResultKey.equals(QueryResultKey.java:81) at java.util.HashMap.put(HashMap.java:376) at org.apache.solr.search.LRUCache.put(LRUCache.java:123) at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1377) at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:457) at org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:410) at org.apache.solr.spelling.SpellCheckCollator.collate(SpellCheckCollator.java:112) at org.apache.solr.handler.component.SpellCheckComponent.addCollationsToResponse(SpellCheckComponent.java:203) at org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:180) at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:208) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1817) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:639) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:345) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:141) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436) at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:662)
        Hide
        Yonik Seeley added a comment -

        The issue was that the spell check component reused the query component to check collations, and the query component wasn't originally written with that in mind and it modified the list of filters even though that list of filters had already been used.

        This simple patch just makes a copy of any existing filter list before adding new filters from the "fq" list.

        Show
        Yonik Seeley added a comment - The issue was that the spell check component reused the query component to check collations, and the query component wasn't originally written with that in mind and it modified the list of filters even though that list of filters had already been used. This simple patch just makes a copy of any existing filter list before adding new filters from the "fq" list.
        Hide
        ASF subversion and git services added a comment -

        Commit 1500903 from Yonik Seeley
        [ https://svn.apache.org/r1500903 ]

        SOLR-5019: don't modify original filter list

        Show
        ASF subversion and git services added a comment - Commit 1500903 from Yonik Seeley [ https://svn.apache.org/r1500903 ] SOLR-5019 : don't modify original filter list
        Hide
        James Dyer added a comment -

        Just curious if there is an easy addition/change to SpellCheckCollatorTest that would make it fail prior to the fix?

        Show
        James Dyer added a comment - Just curious if there is an easy addition/change to SpellCheckCollatorTest that would make it fail prior to the fix?
        Hide
        ASF subversion and git services added a comment -

        Commit 1500914 from Yonik Seeley
        [ https://svn.apache.org/r1500914 ]

        SOLR-5019: don't modify original filter list

        Show
        ASF subversion and git services added a comment - Commit 1500914 from Yonik Seeley [ https://svn.apache.org/r1500914 ] SOLR-5019 : don't modify original filter list
        Hide
        Yonik Seeley added a comment -

        Just curious if there is an easy addition/change to SpellCheckCollatorTest that would make it fail prior to the fix?

        None that I could think of unfortunately.

        Show
        Yonik Seeley added a comment - Just curious if there is an easy addition/change to SpellCheckCollatorTest that would make it fail prior to the fix? None that I could think of unfortunately.
        Hide
        Steve Rowe added a comment -

        Bulk close resolved 4.4 issues

        Show
        Steve Rowe added a comment - Bulk close resolved 4.4 issues

          People

          • Assignee:
            Yonik Seeley
            Reporter:
            Yonik Seeley
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development