-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Gevent greenlet stuck when using stream recognize request in a separate thread. #12535
Comments
So upon load testing, I found that if I have 30 concurrent streaming recognize sessions, it would create problem where all threads stuck. I have tried to use both gevent greenlet and native thread pool, nothing helps with this limit. On the other hand, concurrency under 25 seems to work fine. I've also seen this post arguing about grpc max concurrency settings. I assume we are using grpc underneath this speech recognition package. Is there a way we can increase concurrency on speech client? Could someone help take a look? Thank you so much! |
Hi @dongzeli95 , Thanks for reporting this issue. This is potentially related to grpc/grpc#36265, googleapis/python-bigtable#949 and #12423. To confirm, can you try downgrading to |
@parthea Just confirmed that changing dependency onto |
I have seen a similar issue a number of times on my development server, which we believe might be related to deadlocks that occurred on production too. When I have the gevent monitor thread running I get this:
A common thread I think I've seen in most of the related issues to this is just some Google API that's using gRPC for transport, called from a In my case it happens to be coming from the Trace API, but others have reported a similar problem against other APIs, including this one. I tried a reproduction similar to googleapis/python-bigtable#949 (comment) but couldn't get the problem to happen so far that way, even though it bears similarity to a simplified version of what's going on in the production server. I have grpc==1.68.0 for what it's worth. |
This is my code for running each recognize task in a separate gevent greenlet and this causes the greenlet to stuck:
I've also included patch for my gevent application:
So after the above greenlet stuck, my whole application will basically hang.
Note that if I do the stream recognition synchronously without using gevent greenlet, it works fine. However I still prefer to use it in separate thread to improve on latency. I wonder if this is also another grpc incompatibility issue with gevent.
The text was updated successfully, but these errors were encountered: