Open lenolib opened 8 years ago
@lenolib I know this is a very old issue, but thank you for pointing me in the right direction after a frustrating hour of debugging a flask-sockets application that would sometimes drop connections completely silently with no error output from Gunicorn.
The culprit was a KeyError in the socket handler, and as noted above KeyErrors are silently absorbed by the library. The solution suggestion above works for me as well.
@pddenhar It brings me joy that my finding was helpful to you after such a long time.
If a KeyError is thrown in the handler, it will be caught and no log output will be produced. It bit me and it took some time to figure out what was happening. Proposed fix: try-except-KeyError only the
environ
lookup.https://github.com/kennethreitz/flask-sockets/blob/master/flask_sockets.py#L47