Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-53281

Solr may timeout during optimize

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Component/s: Global search
    • Labels:

      Description

      After index updates, optimize is called on Solr. The problem is that Solr may take longer than the default 30 second timeout to index (on our dataset it's taking about 45 seconds).

      Scheduled task failed: Global search indexing (core\task\search_task),Solr HTTP Error 28: 'Timeout was reached' 
      Backtrace:
      * line 332 of /search/engine/solr/classes/engine.php: call to SolrClient->optimize()
      * line 461 of /search/classes/manager.php: call to search_solr\engine->optimize()
      * line 58 of /lib/classes/task/search_task.php: call to core_search\manager->optimize_index()
      * line 137 of /admin/tool/task/cli/schedule_task.php: call to core\task\search_task->execute()
      

      While the timeout isn't that horrible (the optimize seems to complete anyways), it results in the task "failing" because the exception isn't caught.

      I recommend two solutions (I would do both):

      1. Catch timeout exceptions and just discard them. We don't track or return the output of optimize, so we can just catch the SolrClientException and pitch it.
      2. Add a param to get_search_client (or the constructor of engine) that allows you to get an "maintenance" client, which has a long(er) timeout set, much in the same way we set long timeouts when doing various other tasks in Moodle.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              emerrill Eric Merrill
              Reporter:
              emerrill Eric Merrill
              Peer reviewer:
              David Monllaó
              Integrator:
              Andrew Nicols
              Tester:
              Adrian Greeve
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                23/May/16