elastic / elastic/elastic-transport-python

Bump minimum aiohttp to 3.7.0 or greater

Open
#94 0 comments 0 reactions 0 assignees View on GitHub
tracking
Dominant language
Python
Stars
24
Forks
19
PR merge metrics
No merged PRs in 30d

Description

The old workaround mentioned in #49 has a limitation we hit pretty hard this week. It seems if the GET body is large enough it causes tasks immediately proceeding the pseudo-HEAD call to fail. More info is available in elastic/rally#1580, but I will put a reproduction here:
Given an environment with `elasticsearch[async]==8.4.0 aiohttp<3.7.0`:

```python
import asyncio

import elasticsearch
import json

es = elasticsearch.AsyncElasticsearch(
hosts="http://localhost:9200",
http_auth=("elastic-admin", "elastic-password")
)
print(elasticsearch.__version__)

print('Load index mappings and settings')
mappings=json.load(open('index.json'))

async def main():
print('Clean index')
delete_resp = await es.indices.delete(index='tsdb', ignore=[400, 404])

print('Create index')
create_resp = await es.indices.create(index='tsdb', body=mappings)

print('Exists? Index')
exists_resp = await es.indices.exists(index='tsdb')
print('Delete index fails on timeout...')
delete_resp = await es.indices.delete(index='tsdb', ignore=[400, 404])

await es.close()

asyncio.run(main())
```

where `index.json` is the content of the attached file [index.json.zip](https://github.com/elastic/elastic-transport-python/files/9560582/index.json.zip). If you trace with Wireshark, etc, you can see the response comes back successfully from the server, but the transport library doesn't recognize it arrived and it times out.

`pip install aiohttp==3.7.0` fixes the issue

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.