You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
In the old elasticsearch_async library, when creating a AsyncElasticsearch object, we can set value for use_dns_cache to disable dns caching. However, this does not work right now.
Code snippet:
from elasticsearch import AsyncElasticsearch
es_client = AsyncElasticsearch(
hosts=conf['endpoints'],
loop=loop,
timeout=conf.get('request_timeout_seconds'),
use_dns_cache=False, # We use ELB to balance the load
)
connection = elastic_client.transport.get_connection()
print(connection.session.connector.use_dns_cache)
I am expecting the output to be False, but it is always True right now.
Am I doing something wrong to set the use_dns_cache value?
The text was updated successfully, but these errors were encountered:
Hello! It is indeed not configurable. I'm unlikely to add that feature in the 7.17 client, but could definitely consider it in the 8.x client. Thanks.
Thanks for the reply!
Just to clarify: We have to use dns_cache regardless 7.x or 8.x right now when creating the client. But, can we change it later through another function call by any chance? If not, does that mean we have to use dns_cache all the time right now with es client? Were it every being configurable after making AsyncElasticsearch native instead of using elasticsearch_async lib? Thanks
Hey, sorry for missing your reply here. Trying to answer your questions point by point:
I don't know about how it used to work with elasticsearch-async, this was deprecated four years ago now and I never worked on it myself (but I do remember using it!).
We don't currently support changing the internals of the transport. I could teach how to make it work today in 8.13, but it could break in a future release
elasticsearch-py version: v7.17.9
Description:
In the old elasticsearch_async library, when creating a AsyncElasticsearch object, we can set value for use_dns_cache to disable dns caching. However, this does not work right now.
Code snippet:
I am expecting the output to be False, but it is always True right now.
Am I doing something wrong to set the
use_dns_cache
value?The text was updated successfully, but these errors were encountered: