Skip to content

Commit

Permalink
Hotfix: Increase ES timeout and retries (#3301)
Browse files Browse the repository at this point in the history
  • Loading branch information
AetherUnbound authored Nov 1, 2023
1 parent 591dd7c commit 10797ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api/api/controllers/search_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 new
if search_params.validated_data["sort_by"] == INDEXED_ON:
Expand Down
6 changes: 4 additions & 2 deletions api/conf/settings/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 10797ee

Please sign in to comment.