Commit fa8b3fef authored by Dominik Charousset's avatar Dominik Charousset

Call quit from default exit handler and for kill

parent 9ed02db5
...@@ -60,14 +60,12 @@ result<message> drop(scheduled_actor*, message_view&) { ...@@ -60,14 +60,12 @@ result<message> drop(scheduled_actor*, message_view&) {
// -- static helper functions -------------------------------------------------- // -- static helper functions --------------------------------------------------
void scheduled_actor::default_error_handler(scheduled_actor* ptr, error& x) { void scheduled_actor::default_error_handler(scheduled_actor* ptr, error& x) {
ptr->fail_state_ = std::move(x); ptr->quit(std::move(x));
ptr->setf(is_terminated_flag);
} }
void scheduled_actor::default_down_handler(scheduled_actor* ptr, down_msg& x) { void scheduled_actor::default_down_handler(scheduled_actor* ptr, down_msg& x) {
aout(ptr) << "*** unhandled down message [id: " << ptr->id() aout(ptr) << "*** unhandled down message [id: " << ptr->id()
<< ", name: " << ptr->name() << "]: " << to_string(x) << ", name: " << ptr->name() << "]: " << to_string(x) << std::endl;
<< std::endl;
} }
void scheduled_actor::default_exit_handler(scheduled_actor* ptr, exit_msg& x) { void scheduled_actor::default_exit_handler(scheduled_actor* ptr, exit_msg& x) {
...@@ -542,8 +540,7 @@ scheduled_actor::categorize(mailbox_element& x) { ...@@ -542,8 +540,7 @@ scheduled_actor::categorize(mailbox_element& x) {
unlink_from(em.source); unlink_from(em.source);
// exit_reason::kill is always fatal // exit_reason::kill is always fatal
if (em.reason == exit_reason::kill) { if (em.reason == exit_reason::kill) {
fail_state_ = std::move(em.reason); quit(std::move(em.reason));
setf(is_terminated_flag);
} else { } else {
call_handler(exit_handler_, this, em); call_handler(exit_handler_, this, em);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment