-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question/enhancement] Why do we not Recover
from panic
handlers?
#471
Comments
Probably this will be the better option.
|
We could add Having users add the |
Fair enough, however this behavior (i.e. crashing the entire server on any See pull request #475. |
I merged the pull requests that adds extra documentation. |
Currently a handler that
panic
's will bring down the whole server, thus impacting other outstanding connections and handlers.Thus I asked myself why doesn't
fasthttp
protect its connection handler routine with aRecover
, thus dropping only that connection? Is it by design?Now (answering and debating with myself) :) I can see both sides of the argument:
if we don't handle panics, then any small hidden bug would take the whole server down, and if that bug can somehow be easily triggered by the requester, then we end up with a very efficient denial-of-service attack; (even if we use a process supervision, if the server keeps going down, the supervisor will start delaying the restart;)
however if we do handle panics and just log them, then a major failure in our code would get unnoticed by the supervisor which will prevent a restart that might (temporarily) solve the issue;
As such perhaps a "combined" approach can be taken:
The limits could be either absolute (i.e. this many requests) or percentage (of all served requests). In case of global percentage limit, there should be a small "burst" that would cover any initial temporary failures caused by "initialization" dependencies or failures.
The text was updated successfully, but these errors were encountered: