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

bug: AsyncHttpClient sends two sync requests on construction #5290

Closed
Kakadus opened this issue Mar 24, 2025 · 0 comments · Fixed by #5296
Closed

bug: AsyncHttpClient sends two sync requests on construction #5290

Kakadus opened this issue Mar 24, 2025 · 0 comments · Fixed by #5296
Labels
bug Something isn't working

Comments

@Kakadus
Copy link

Kakadus commented Mar 24, 2025

Describe the bug

See https://github.com/bentoml/BentoML/blob/main/src/_bentoml_impl/client/http.py#L183-L186 and https://github.com/bentoml/BentoML/blob/main/src/_bentoml_impl/client/http.py#L332-L334. This completely hangs the event queue. As we used to create new clients repeatedly, this adds up.

I suggest wrapping AsyncHttpClient in a await asyncio.get_running_loop().run_in_executor(None, AsyncHttpClient) for now.

To reproduce

Add breakpoints to the quoted code and run:

AsyncHttpClient()

Expected behavior

I expect that all http requests are done asynchronously with the AsyncHttpClient.

Environment

bentoml: v1.4.5
python: 3.12
environment: Arch Linux

@Kakadus Kakadus added the bug Something isn't working label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant