From: Martin Quinson Date: Fri, 2 Aug 2019 18:12:24 +0000 (+0200) Subject: forcefully kill exiting actors even if their host is not off X-Git-Tag: v3.24~211 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c112965cc1bb1726d51503a29f7883ddb00f4f46 forcefully kill exiting actors even if their host is not off Without this, this_actor::exit() deadlocks on Thread factory because the actor does not exit soon enough to release maestro that is joining its thread. --- diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index 0db52ef1a3..c8640b4762 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -199,10 +199,6 @@ void ActorImpl::exit() suspended_ = false; exception_ = nullptr; - // Forcefully kill the actor if its host is turned off. Not a HostFailureException because you should not survive that - if (not host_->is_on()) - this->throw_exception(std::make_exception_ptr(ForcefulKillException("host failed"))); - /* destroy the blocking synchro if any */ if (waiting_synchro != nullptr) { waiting_synchro->cancel(); @@ -225,6 +221,9 @@ void ActorImpl::exit() waiting_synchro = nullptr; } + + // Forcefully kill the actor if its host is turned off. Not a HostFailureException because you should not survive that + this->throw_exception(std::make_exception_ptr(ForcefulKillException(host_->is_on() ? "exited" : "host failed"))); } void ActorImpl::kill(ActorImpl* actor)