-
Bug
-
Resolution: Fixed
-
Minor
-
3.1
-
MOODLE_31_STABLE
-
MOODLE_31_STABLE
-
MDL-53281-master -
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):
- 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.
- 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.
- has a non-specific relationship to
-
MDL-53325 Don't optimize solr after every indexing run
- Closed