Closed daanraman closed 4 years ago
Elasticsearch reconnections are now wrapped in a 1 minute sleep cycle to avoid this issue.
Example:
# Initialize Elasticsearch connection
while not es.init_connection():
time.sleep(60)
Tested this in a local deployment where the connection fails - sleep is respected.
Currently it is ElasticSearch library that try again to connect to database (due to parameter
retry_on_timeout
set onTrue
).So to add timer between each connection test, two solution are possible:
There is maybe a possibility to fetch log and only display a small message (and not all the trace)
EDIT: Linked to this: https://github.com/NVISO-BE/ee-outliers/blob/master/app/helpers/es.py#L52 EDIT2: Interesting stuff about that: https://github.com/elastic/elasticsearch-py/issues/666