Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
extend failure to parallel activities owned by maestro
authorSUTER Frederic <frederic.suter@cc.in2p3.fr>
Mon, 20 Dec 2021 20:09:43 +0000 (21:09 +0100)
committerSUTER Frederic <frederic.suter@cc.in2p3.fr>
Mon, 20 Dec 2021 20:09:43 +0000 (21:09 +0100)
src/surf/HostImpl.cpp

index 73347df..4fe0ac9 100644 (file)
@@ -101,9 +101,12 @@ void HostImpl::turn_off(const actor::ActorImpl* issuer)
   }
   for (auto& activity : EngineImpl::get_instance()->get_maestro()->activities_) {
     auto* exec = dynamic_cast<activity::ExecImpl*>(activity.get());
-    if (exec != nullptr && exec->get_host() == &piface_) {
-      exec->cancel();
-      exec->state_ = activity::State::FAILED;
+    if (exec != nullptr) {
+      auto hosts = exec->get_hosts();
+      if (std::find(hosts.begin(), hosts.end(), &piface_) != hosts.end()) {
+        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.