Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Hotfix: Increase ES timeout and retries (#3301)
Madison Swain-Bowden10797eefd345
diff --git a/api/api/controllers/search_controller.py b/api/api/controllers/search_controller.pyindex 8d5c9065d..a9bf0b926 100644--- a/api/api/controllers/search_controller.py+++ b/api/api/controllers/search_controller.py@@ -438,7 +438,8 @@ def search(s.extra(track_scores=True)# Route users to the same Elasticsearch worker node to reduce# pagination inconsistencies and increase cache hits.- s = s.params(preference=str(ip), request_timeout=7)+ # TODO: Re-add 7s request_timeout when ES stability is restored+ s = s.params(preference=str(ip))# Sort by newif search_params.validated_data["sort_by"] == INDEXED_ON:diff --git a/api/conf/settings/elasticsearch.py b/api/conf/settings/elasticsearch.pyindex c5a8f48b3..19aba5376 100644--- a/api/conf/settings/elasticsearch.py+++ b/api/conf/settings/elasticsearch.py@@ -22,8 +22,10 @@ def _elasticsearch_connect() -> tuple[Elasticsearch, str]:_es = Elasticsearch(es_endpoint,- request_timeout=10,- max_retries=1,+ # TODO: Return to default timeout of 10s and 1 retry once+ # TODO: Elasticsearch response time has been stabilized+ request_timeout=12,+ max_retries=3,retry_on_timeout=True,)_es.info()