-
Notifications
You must be signed in to change notification settings - Fork 78
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
Connection hang up with gunicorn + uvicorn workers #1292
Comments
that is probably because we migrated the client to use async internally - could you try using our async client? Here are our docs and a fastAPI example |
Hi @JanHoellmer, I'll look into exactly what is causing the hang with |
Thanks for the hint, have not seen that yet. |
If you choose to move away from |
I tested both:
But thanks again for the hint with |
@JanHoellmer, when you say
do you mean this one? If so, this is entirely inline with the client implementation as it is not multi-processing safe so if it is initialised in one process and then used in another then it won't function correctly as you observed! If not, which other hook were you using specifically that was causing the hanging behaviour? |
Yes, it is the one you linked. |
When you connect to a Weaviate instance in the Gunicorn
on_startup
server hook and close the connection, afterwards I'm unable to connect again inside the uvicorn workers (deployment setup for FastAPI application).gunicorn.conf.py
app.py (FastAPI)
Run with
gunicorn -b 0.0.0.0:8000 -c gunicorn.conf.py app:app
.Inside the on_starting hook, i can close and connect as often as I want, same for inside the FastAPI application. As soon as i close the connection to Weaviate once in the on_starting hook, connect_to_custom hangs up inside the application. This first happened with Weaviate python client version 4.7.0 (4.7.1 & 4.8.0 also don't work), for versions <= 4.6.7 everything works fine.
Weaviate Server Version: 1.26.1
The text was updated successfully, but these errors were encountered: