Recently I'm developing a Flask website/api app to Windows Server and saw some weird issue going on.
When someone make a request to a url, occasionally(like 3-4 out of 10 times) it will hang. All I need to do to make that request come through is going to the command line where I fire up the Flask server, and send an interrupt signal. (I'm on windows, so basically "Ctrl + C"). I've googled for a while, but I believe none of the solutions applies. Here's what I've tried:
- add
threaded=true
inapp.run()
as suggested here didn't work. - In This link, Author mentioned that some browser may fire up multiple requests at the same time and make the server confused. This probably doesn't apply here either since I've tried to make request from python's
requests
library and still see the server hangs. - Use Gevent or Tornado to serve app as mentioned in here didn't work either.
- Tried both on python 3 and python 2.7, had same issue.
I have pretty much same setup on my local machine(win7 64bit) and everything just works fine. (The server that has issue is Windows Server 2012)
I'd love to share some code, but I highly doubt it would be code issue, since it works perfectly fine locally.
Has anyone experienced the same thing before?