mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
init: avoid too eager child restart
This patch weakens the aggressive restart of a child with incomplete environment sessions. The restart check is performed each time the init configuration changes. In sculpt, this is not a rare special case anymore but a frequent case when using the depot_rom as provider for environment ROM sessions. In particular when starting a chain of inter-depending children, the sculpt-manager quickly generates a sequence of configurations with successively added start nodes.
This commit is contained in:
parent
648539a513
commit
6491ba0589
@ -33,9 +33,18 @@ Init::Child::apply_config(Xml_node start_node)
|
||||
* If the child's environment is incomplete, restart it to attempt
|
||||
* the re-routing of its environment sessions.
|
||||
*/
|
||||
if (!_child.active()) {
|
||||
abandon();
|
||||
return MAY_HAVE_SIDE_EFFECTS;
|
||||
{
|
||||
bool env_log_exists = false, env_binary_exists = false;
|
||||
_child.for_each_session([&] (Session_state const &session) {
|
||||
Parent::Client::Id const id = session.id_at_client();
|
||||
env_log_exists |= (id == Parent::Env::log());
|
||||
env_binary_exists |= (id == Parent::Env::binary());
|
||||
});
|
||||
|
||||
if (!env_binary_exists || !env_log_exists) {
|
||||
abandon();
|
||||
return MAY_HAVE_SIDE_EFFECTS;
|
||||
}
|
||||
}
|
||||
|
||||
bool provided_services_changed = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user