Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Mark actors as auto_restart when recreating them on restart.
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 17 Aug 2018 23:21:12 +0000 (01:21 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 17 Aug 2018 23:21:15 +0000 (01:21 +0200)
I guess it often works without it because we restart the actors that
are in the actors_at_boot_ vector, and that list is sufficiently
accurate.

But still, several locations of the code actually look if the actor is
marked auto_restart_ without checking the vector, so it's much better
having redundent information source to contain the same data.

src/surf/HostImpl.cpp

index 26acadd..401ee6d 100644 (file)
@@ -132,6 +132,8 @@ void HostImpl::turn_on()
                                                               arg->properties.get(), nullptr);
     if (arg->kill_time >= 0)
       simcall_process_set_kill_time(actor, arg->kill_time);
                                                               arg->properties.get(), nullptr);
     if (arg->kill_time >= 0)
       simcall_process_set_kill_time(actor, arg->kill_time);
+    if (arg->auto_restart)
+      actor->auto_restart_ = arg->auto_restart;
     if (arg->daemon_)
       actor->daemonize();
   }
     if (arg->daemon_)
       actor->daemonize();
   }