Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-1711

Race condition in org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.4, 1.5
    • 3.1, 4.0-ALPHA
    • clients - java
    • None

    Description

      While inserting a large pile of documents using StreamingUpdateSolrServer there is a race condition as all Runner instances stop processing while the blocking queue is full. With a high performance client this could happen quite often, there is no way to recover from it at the client side.

      In StreamingUpdateSolrServer there is a BlockingQueue called queue to store UpdateRequests, there are up to threadCount number of workers threads from StreamingUpdateSolrServer.Runner to read that queue and push requests to a Solr instance. If at one point the BlockingQueue is empty all workers stop processing it and pushing the collected content to Solr which could be a time consuming process, sometimes all worker threads are waiting for Solr. If at this time the client fills the BlockingQueue to full all worker threads will quit without processing any further and the main thread will block forever.

      There is a simple, well tested patch attached to handle this situation.

      Attachments

        1. StreamingUpdateSolrServer.patch
          1 kB
          Attila Babo
        2. SOLR-1711.patch
          3 kB
          Yonik Seeley

        Issue Links

          Activity

            People

              yseeley@gmail.com Yonik Seeley
              a_babo Attila Babo
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified