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
Speech: Connections stay open in ESTABLISHED or CLOSE_WAIT state #5570
Comments
Btw, this seems somewhat related to #5523 and similar to this 2-year old issue in stack overflow: https://stackoverflow.com/questions/34794516/gcloud-python-close-connection |
Seems this should maybe be moved to gRPC, @tseaver? |
@theacodes You likely know better than I. :) |
This issue was moved to grpc/grpc#15990 |
hello @theacodes, the problem persists and according to @srini100 on grpc/grpc#15990 it's not on the grpc side of things. Anything we can do about it? |
If you're only using one client then I'm not sure. It could be requests? |
I'm also experiencing the same issue, which is similar to and reported here: #5523 I get it on Windows and on Linux using Python 3.6.5. I am using requests module version '2.18.4' and I recently tried upgrading to '2.19.1'. It would appear as though I'm getting the same issue regardless of version. Regarding grpc, seems like I'm using '1.14.1'. It seems to me as though grpc is the issue here in that "Since there is no guarantee that memory is the only resource consumed by a grpc.Channel and since some garbage collectors only collect garbage when memory is scarce, there is a liability that applications might run out of those other resources (file descriptors and so on) when they are in fact perfectly reclaimable." from here: grpc/grpc#12531 |
@theacodes at this point, should I create a docker image with a minimal way to reproduce it and share it with you? or would you suggest stop using the library and start hitting the HTTP endpoint directly (is that even possible?) |
OS: CentOS Linux release 7.2.1511 (Core)
Python 2.7.5
google-cloud-speech Version: 0.27.0
Steps to reproduce:
After using the google speech client do:
lsof -p <pid>
or:
netstat -a
and you'll notice that there are some TCP connections still in ESTABLISHED or CLOSE_WAIT state.
The foreign addresses belong to Google. These connections remain open and, if the client is used a lot, will create problems of the type "IOError: [Errno 24] Too many open files". I'm using this inside a cherrypy server, so it actually makes my server hang after a while.
I noticed that some of the connections close themselves after some minutes, but some of them seem to remain there no matter what. I'm wondering if there is a way to close the connections opened by the speech client after finishing a Recognize call.
Code example
The text was updated successfully, but these errors were encountered: