Skip to content
Advertisement

Multiple CLOSE_WAIT when using google cloud speech api with tornado server. Too many open files error

I am getting multiple threads of the same process in CLOSE_WAIT because of which i am getting ‘too many files open’ error.

JavaScript

This is happening when multiple calls to google cloud speech api is made.

Have gone through various answers on stackoverflow, but i am unable to figure out the solution.

JavaScript

The code I have shared is a trimmed version of the actual code. I am able to reproduce the error using the code below.

JavaScript

Please suggest if I am doing something wrong and how to fix this.

Advertisement

Answer

This known issue in the google-cloud-python as well as gcloud-pythonhttps://github.com/googleapis/google-cloud-python/issues/5570. I dropped it and since then I’ve been using google API directly.

As side note, you are using synchronous API, but to leverage Tornado (actually any asynchronous framework) you should use async libs/calls etc like google-cloud-python’s Asynchronous Recognition

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement