Solr
  1. Solr
  2. SOLR-2192

StreamingUpdateSolrServer not thread safe

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 1.4.2, 3.1, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      test error method suggest thread safety violation

      1. SOLR-2192.patch
        0.8 kB
        Yonik Seeley

        Activity

        Hide
        Yonik Seeley added a comment -

        Build: http://hudson.zones.apache.org/hudson/job/Lucene-Solr-tests-only-3.x/508/

        1 tests failed.
        REGRESSION:  org.apache.solr.client.solrj.embedded.SolrExampleStreamingTest.testStatistics
        
        Error Message:
        null
        
        Stack Trace:
        java.util.NoSuchElementException
               at java.util.LinkedList.getFirst(LinkedList.java:126)
               at java.util.LinkedList.peek(LinkedList.java:466)
               at org.apache.solr.client.solrj.impl.StreamingUpdateSolrServer.blockUntilFinished(StreamingUpdateSolrServer.java:251)
               at org.apache.solr.client.solrj.impl.StreamingUpdateSolrServer.request(StreamingUpdateSolrServer.java:198)
               at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
               at org.apache.solr.client.solrj.SolrServer.commit(SolrServer.java:86)
               at org.apache.solr.client.solrj.SolrServer.commit(SolrServer.java:75)
               at org.apache.solr.client.solrj.SolrExampleTests.testStatistics(SolrExampleTests.java:444)
               at org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(LuceneTestCase.java:779)
               at org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(LuceneTestCase.java:745)
        
        Show
        Yonik Seeley added a comment - Build: http://hudson.zones.apache.org/hudson/job/Lucene-Solr-tests-only-3.x/508/ 1 tests failed. REGRESSION: org.apache.solr.client.solrj.embedded.SolrExampleStreamingTest.testStatistics Error Message: null Stack Trace: java.util.NoSuchElementException at java.util.LinkedList.getFirst(LinkedList.java:126) at java.util.LinkedList.peek(LinkedList.java:466) at org.apache.solr.client.solrj.impl.StreamingUpdateSolrServer.blockUntilFinished(StreamingUpdateSolrServer.java:251) at org.apache.solr.client.solrj.impl.StreamingUpdateSolrServer.request(StreamingUpdateSolrServer.java:198) at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105) at org.apache.solr.client.solrj.SolrServer.commit(SolrServer.java:86) at org.apache.solr.client.solrj.SolrServer.commit(SolrServer.java:75) at org.apache.solr.client.solrj.SolrExampleTests.testStatistics(SolrExampleTests.java:444) at org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(LuceneTestCase.java:779) at org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(LuceneTestCase.java:745)
        Hide
        Yonik Seeley added a comment -

        The only way I figure peek() could fail is if the LinkedList was being used in a non-thread safe manner.

        Show
        Yonik Seeley added a comment - The only way I figure peek() could fail is if the LinkedList was being used in a non-thread safe manner.
        Hide
        Yonik Seeley added a comment -

        Yep - a quick look shows that "runners" is normally synchronized on itself, but it's not in
        blockUntilFinished

        Show
        Yonik Seeley added a comment - Yep - a quick look shows that "runners" is normally synchronized on itself, but it's not in blockUntilFinished
        Hide
        Yonik Seeley added a comment -

        Here's a patch that synchronizes on runners only enough to call peek()

        Show
        Yonik Seeley added a comment - Here's a patch that synchronizes on runners only enough to call peek()
        Hide
        Grant Ingersoll added a comment -

        Bulk close for 3.1.0 release

        Show
        Grant Ingersoll added a comment - Bulk close for 3.1.0 release

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development