Skip to content

fix(launch_manager): validate recovery_client in PGM initialize - #1077

Open
MohamedRady-99 wants to merge 1 commit into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/918-pgm-recovery-client-validation
Open

MohamedRady-99 wants to merge 1 commit into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/918-pgm-recovery-client-validation

Conversation

@MohamedRady-99

@MohamedRady-99 MohamedRady-99 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Issue: #918

Description

Previously, `ProcessGroupManager` only validated `recovery_client_` via a debug assertion in the constructor. In release/production builds (where
debug assertions are disabled), passing a null `recovery_client` caused a Segmentation Fault during `initialize()` when attempting to register the
recovery callback, or could result in silently running without supervision failure notifications.

Changes

- Added explicit validation in `ProcessGroupManager::initialize()` to check if `recovery_client_ == nullptr`, log an error, and return `false`,
preventing the Launch Manager from starting up in an unsafe state.
- Guarded `watchdog_` and `alive_monitor_` pointers in `deinitialize()`.
- Added unit test `InitializeFailsWhenRecoveryClientIsNull` in `process_group_manager_UT.cpp` to verify clean initialization rejection.

@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-1077: https://eclipse-score.github.io/lifecycle/pr-1077/

{
RecordProperty(
"Description", "Verify that initialize() returns false and fails startup cleanly if recovery_client is null.");
EXPECT_CALL(*watchdog_, disable()).Times(1);

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.

Can you make this just a TEST so that the test fixture is not used. Otherwise this line is confusing as this is just for the teardown of the pgm from the fixture that is not used.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hello @MaciejKaszynski,

Thank you for the review. I’ve converted the test into a standalone TEST(ProcessGroupManagerTest, InitializeFailsWhenRecoveryClientIsNull) and removed the unused fixture expectations for watchdog_ and alive_monitor_.

Could you please take another look when you have a chance?

Thank you!

@MohamedRady-99
MohamedRady-99 force-pushed the fix/918-pgm-recovery-client-validation branch from b9ba8b4 to 44c8bdb Compare November 29, 2026 15:19

This branch is waiting to be deployed

1 waiting deployment
workflow-approval — 44c8bdb1 Waiting Nov 29, 2026 by MohamedRady-99 via Build and test arm64-qnx / approval #2925
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.

2 participants