Skip to content

fix: escalate ProcessInfoNode construction failures - #616

Open
shegazyy wants to merge 1 commit into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/escalate-process-info-node-construction-failures
Open

shegazyy wants to merge 1 commit into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/escalate-process-info-node-construction-failures

Conversation

@shegazyy

@shegazyy shegazyy commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Previously, if alive supervision construction failed inside ProcessInfoNode's constructor, the failure was logged and startup continued anyway with a null supervision handle.

Convert ProcessInfoNode's constructor to a Create() factory that returns an error (kErrorBeforeReady) if alive supervision setup fails. Propagate that failure through Graph::Create() (also converted from a plain constructor to a factory, since building the dependency graph can now fail) up to ProcessGroupManager::initializeProcessGroups(), which already fails startup on false.

Also fixes a latent bug found while adding this: ProcessInfoNode's move constructor did not preserve start_tries_ or termination_result_, silently resetting configured restart attempts to 1 on every move. This was previously undetectable because the move constructor was never exercised on ordinary construction; Create() now moves through it at least once.

Fixes #606

Previously, if alive supervision construction failed inside
ProcessInfoNode's constructor, the failure was logged and startup
continued anyway with a null supervision handle.

Convert ProcessInfoNode's constructor to a Create() factory that
returns an error (kErrorBeforeReady) if alive supervision setup fails.
Propagate that failure through Graph::Create() (also converted from a
plain constructor to a factory, since building the dependency graph
can now fail) up to ProcessGroupManager::initializeProcessGroups(),
which already fails startup on false.

Also fixes a latent bug found while adding this: ProcessInfoNode's
move constructor did not preserve start_tries_ or termination_result_,
silently resetting configured restart attempts to 1 on every move.
This was previously undetectable because the move constructor was
never exercised on ordinary construction; Create() now moves through
it at least once.
@shegazyy

shegazyy commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Hello @WilliamRoebuck I applied the needed changes and ready for review whenever you have the time>

@WilliamRoebuck WilliamRoebuck left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the delayed response, I have been away.
Unfortunately, I think we'll have to find a different way to escalate the failure, as using a Create method as I proposed means we would not be able to emplace ProcessInfoNodes into the dependency graph, and would need to use a move. I'm sorry to have overlooked this when creating the issue. An alternative solution could be for the caller (Graph) to construct each node's alive supervision and then pass the handle to the ProcessInfoNode's in-place constructor if that construction succeeds. I'll update #606


const auto index = graph.try_emplace(
IdentifierHash{name}, std::in_place_type<ProcessInfoNode>, std::move(component_config), process_handling);
auto node_res = ProcessInfoNode::Create(std::move(component_config), process_handling);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think losing the in-place construction here is a problem for efficiency on large graphs. However, I can see that with the Create method it will be very difficult to emplace. I'll have to change the proposed solution in the issue, I apologise for misleading you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Escalate ProcessInfoNode construction failures

2 participants