-
Notifications
You must be signed in to change notification settings - Fork 349
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
System::stop_on_panic is removed. #80
Comments
@mikhailOK How do you emulate the stop on panic with panic hook? |
@XX currently this way:
|
I dug into this a little bit. It seems that See for example here: actix-net/actix-server/src/builder.rs Lines 410 to 438 in 235a76d
and here: actix-net/actix-server/src/accept.rs Lines 419 to 431 in 235a76d
|
use actix-server can be used stand alone and you are free to make worker panic and restart. So worker restart feature is here to stay and remove it is not accepted. |
Seems like #255 removed the
|
Sorry that's outside the scope of actix-server. You can add your own panic handle by using |
Would panic handling functionality make sense for |
I did not make the change to |
@mikhailOK I edited the title of issue and re-opened. Hope you don't mind as we need it back to implement actual panic stop. |
I walked into the exact problem, and when I ported the deleted snippet in #255 to actix 0.12.0 (here), it worked. Not sure why I also tested this idea on actix-web 4.0.0-beta.8. The program didn't terminate, but new service workers are constructed to accept new connections. I believe this is the expected behavior. |
I'm using
actix-rt 1.0.0
throughactix 0.9.0
and observing that system does not stop on panic.It seems like task panics get caught by tokio runtime
0.2.6
.Relevant tokio issue: tokio-rs/tokio#2002
It also seems like
actix-rt 0.2
always stopped on panic due totokio 0.1
not catching.My current workaround is to set a panic hook that sends a stop signal to current system, so another question: is it possible to make
System::with_current
do nothing if current system is not set?System::current()
andSystem::with_current
require the caller to guarantee it's set.The text was updated successfully, but these errors were encountered: