Elasticsearch version (bin/elasticsearch --version): 8.13.0
elasticsearch-py version (elasticsearch.__versionstr__): 8.13.0
Please make sure the major version matches the Elasticsearch server you are running.
Description of the problem including expected versus actual behavior:
I want to override the mark_dead/mark_live functionality in the NodePool class since it does not make sense in our kubernetes setup which I've simply setup like this:
class NoTimeoutConnectionPool(NodePool):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def mark_dead(self, connection):
# Don't fail a node since we only have a single kubernetes endpoint for our cluster
pass
def mark_live(self, connection):
# Override to do nothing on mark_live
pass
es: AsyncElasticsearch = AsyncElasticsearch(
hosts=[settings.elastic_host],
sniff_on_start=False,
sniff_before_requests=False,
sniff_on_node_failure=False,
request_timeout=20,
node_pool_class=NoTimeoutConnectionPool,
)
But this code simply fails with the errors:
File "/dev/salsa/salsa/services/elastic.py", line 47, in <module>
es: AsyncElasticsearch = AsyncElasticsearch(
^^^^^^^^^^^^^^^^^^^
File "/dev/salsa/.venv/lib/python3.11/site-packages/elasticsearch/_async/client/__init__.py", line 399, in __init__
_transport = transport_class(
^^^^^^^^^^^^^^^^
File "/dev/salsa/.venv/lib/python3.11/site-packages/elastic_transport/_async_transport.py", line 141, in __init__
super().__init__(
File "/dev/salsa/.venv/lib/python3.11/site-packages/elastic_transport/_transport.py", line 237, in __init__
self.node_pool: NodePool = node_pool_class(
^^^^^^^^^^^^^^^^
TypeError: 'DefaultType' object is not callable
Elasticsearch version (
bin/elasticsearch --version
): 8.13.0elasticsearch-py
version (elasticsearch.__versionstr__
): 8.13.0Please make sure the major version matches the Elasticsearch server you are running.
Description of the problem including expected versus actual behavior: I want to override the mark_dead/mark_live functionality in the NodePool class since it does not make sense in our kubernetes setup which I've simply setup like this:
But this code simply fails with the errors:
Which i think is because of a minor typo in https://github.com/elastic/elasticsearch-py/blob/9a650e67dd1ffd84a6de3484dc87c056e190da13/elasticsearch/_async/client/__init__.py#L355
Where
Should be