Wait_any does not trigger new model solve when host events occur
First off, this might be linked somehow to #103 (closed), but I am not sure, hence the new issue.
What I observe is that if (1) a host is turned off and on while it has an actor doing a wait_any and (2) something else is going on that "pushes" the engine into the future, the engine will happily continue looking for other events until the "something else" completes.
This looks potentially wrong to me, because stuff could happen when the host is turned off (e.g. clean up mailbox) or more importantly when the host is turned back on (e.g. an actor starts to send stuff).
Digging into the kernel code, this happens because when I do a wait_any(), the Host (actually the corresponding CpuImpl) does not have an active constraint (resource->used() returns false).
https://framagit.org/simgrid/simgrid/-/blob/master/src/kernel/EngineImpl.cpp#L590
If I did a mailbox::get(), everything would be fine there.
One solution (sufficient for my use case), would be to overload CpuImpl::is_used() to always return true, or if we want to be fancy, check if there is any actor ongoing or waiting to start.
But I wonder if this discrepancy (the lack of active constraints) between old-school calls (e.g. synchronous get()) and shiny wait_any() may be causing harm in other pieces of code (e.g. MC). Do the kernel assume that any running actor will have an active constraint somewhere ?
I enclose a minimal example, which fails to (re-)start the actor when the Bourassa is turned back on at time 6.