Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make sure that actors killed by a timer are properly finished
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 12 Mar 2022 00:01:35 +0000 (01:01 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 12 Mar 2022 00:07:34 +0000 (01:07 +0100)
ActorImpl::exit() does not schedule the victim for execution because
exit() usually denotes a suicide.

When ran from a timer, it's executed in maestro context, so the victim
needs to be scheduled to be properly freed.

It worked properly before commit 2cb8c87fc8 because the actors were
completely destroyed by Context::stop() which is still used here. Now,
the cleanup is split in 2 parts (in actor context and in maestro
context), that are not directly inter-linked.

Gosh, that was a long debug session for a small patch. I hope it's OK now

src/kernel/actor/ActorImpl.cpp

index d271ff0..9e889be 100644 (file)
@@ -258,6 +258,7 @@ void ActorImpl::set_kill_time(double kill_time)
   kill_timer_ = timer::Timer::set(kill_time, [this] {
     this->exit();
     kill_timer_ = nullptr;
+    EngineImpl::get_instance()->add_actor_to_run_list(this);
   });
 }