From: SUTER Frederic Date: Mon, 20 Dec 2021 14:20:39 +0000 (+0100) Subject: make Exec started by maestro fail when a host is turned off X-Git-Tag: v3.30~231 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c81ccd4a2401afbcd8fd8e3c58c68de73c1cf1f8 make Exec started by maestro fail when a host is turned off --- diff --git a/src/surf/HostImpl.cpp b/src/surf/HostImpl.cpp index f105aa5b1c..73347dfe05 100644 --- a/src/surf/HostImpl.cpp +++ b/src/surf/HostImpl.cpp @@ -99,6 +99,13 @@ void HostImpl::turn_off(const actor::ActorImpl* issuer) actor.get_host()->get_cname(), issuer->get_cname()); issuer->kill(&actor); } + for (auto& activity : EngineImpl::get_instance()->get_maestro()->activities_) { + auto* exec = dynamic_cast(activity.get()); + if (exec != nullptr && exec->get_host() == &piface_) { + exec->cancel(); + exec->state_ = activity::State::FAILED; + } + } // When a host is turned off, we want to keep only the actors that should restart for when it will boot again. // Then get rid of the others. auto elm = remove_if(begin(actors_at_boot_), end(actors_at_boot_), [](const actor::ProcessArg* arg) {