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

Can't run Flask+gevent with milvus connections.connect #2071

Open
1 task done
sealzjh opened this issue May 7, 2024 · 3 comments
Open
1 task done

Can't run Flask+gevent with milvus connections.connect #2071

sealzjh opened this issue May 7, 2024 · 3 comments
Assignees
Labels
kind/bug Something isn't working

Comments

@sealzjh
Copy link

sealzjh commented May 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

`
from flask import Flask
from pymilvus import connections, Collection

app = Flask(name)

milvus_config = {
"host": "127.0.0.1",
"port": "19530",
"cover_table": "trend_cover_cnnvec"
}
connections.connect(
alias="default",
host=milvus_config['host'],
port=milvus_config['port']
)
cover_collection = Collection(milvus_config["cover_table"])

@app.route("/health")
def health():
return "ok"

if name == 'main':
app.run(host='0.0.0.0', port=5000)
`

Expected Behavior

不能启动

gunicorn -w 1 -b 0.0.0.0:5000 main:app -k gevent

正常启动

gunicorn -w 1 -b 0.0.0.0:5000 main:app -k eventlet

Steps/Code To Reproduce behavior

run service timeout

Environment details

pymilvus==2.2.6

Anything else?

No response

@sealzjh sealzjh added the kind/bug Something isn't working label May 7, 2024
@xiaofan-luan
Copy link
Contributor

/assign @XuanYang-cn could you help to verifying that

@XuanYang-cn XuanYang-cn self-assigned this May 7, 2024
@XuanYang-cn
Copy link
Contributor

@sealzjh According to grpc team, you need a special patch to make grpc work with gevent, I tested it myself and it works.

Be sure to init_gevent before connect()

grpc/grpc#4629 (comment)

@XuanYang-cn
Copy link
Contributor

/unassign
/assign @sealzjh

@sre-ci-robot sre-ci-robot assigned sealzjh and unassigned XuanYang-cn May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants