Recently, I am developing a flash drive / api application for Windows Server and have seen some strange problems.
When someone makes a request to a URL, sometimes (for example, 3-4 out of 10 times) it will hang. All I have to do to execute this request is go to the command line, where I start the Flask server and send an interrupt signal. (I'm on the windows, so basically "Ctrl + C"). I searched Google for a while, but I believe that none of the solutions apply. Here is what I tried:
- add
threaded=true to app.run() , as suggested here , doesn't work. - In this link , the author mentioned that some browsers can simultaneously run multiple requests and confuse the server. This probably doesn't apply here, since I tried to make a request from the python
requests library and still see the server freezes. - Using Gevent or Tornado to serve the application, as stated in here , also does not work.
- Tried on both python 3 and python 2.7, had the same problem.
I have almost the same setup on my local machine (win7 64bit) and everything just works fine. (The server that has the problem is Windows Server 2012)
I would like to share some code, but I doubt very much that this will be a problem with the code, as it works fine in place.
Has anyone experienced the same thing before?
source share