I'm using Bottle
server to implement my own server using an implementation not so far away from the simple "hello world" here , my own implementation is (without the routing section of course):
bottleApp =bottle.app()
bottleApp.run(host='0.0.0.0',port=80, debug=true)
My server is keep getting unresponsive all the time and then I get in the Browser: Connection reset by peer
, broken pipe errno 32
The logs give me almost exactly the same stack traces such as in question.
What I tried so far, without success:
Wrapping the server run line with try except, something like, shown here the answer of "mhawke". This stopped the error messages in logs, apparently because I caught them in
except
clause, but problem is that when catching the exception like that it means that we have been thrown out of therun
method context, and I want to catch it in a way it will not cause my server to fall.
I don't know if its possible without touching the inner implementations files ofbottle
.Adding this before server run line:
from signal import signal, SIGPIPE, SIG_DFL signal(SIGPIPE,SIG_DFL)
As suggested here, but it seems that it didn't had any impact on not getting Broken pipe\connection reset errors and server responsiveness.I thought of trying also the second answer here, but I don't have any idea where to locate this code in the context of the
bottle
server.