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

Bump minimum aiohttp to 3.7.0 or greater #94

Open
DJRickyB opened this issue Sep 13, 2022 · 0 comments
Open

Bump minimum aiohttp to 3.7.0 or greater #94

DJRickyB opened this issue Sep 13, 2022 · 0 comments

Comments

@DJRickyB
Copy link

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:

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. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant