Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: Increase ES timeout and retries #3301

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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