Skip to content

Comments

Integration#509

Merged
al1img merged 1 commit intoaosedge:feature_unificationfrom
al1img:integration
Feb 20, 2026
Merged

Integration#509
al1img merged 1 commit intoaosedge:feature_unificationfrom
al1img:integration

Conversation

@al1img
Copy link
Collaborator

@al1img al1img commented Feb 11, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 11, 2026 12:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR appears to focus on improving “integration” visibility and status propagation across the system by refactoring SM launcher instance lifecycle handling, enhancing CM update-status reporting, and standardizing/expanding logging.

Changes:

  • Refactor sm::launcher::Launcher stop/start/update flows (instance data management, update-item removal computation, status sending behavior).
  • Add CM UpdateManager-side tracking of “update attempt” statuses for unit-config and nodes, and extend tests to cover this behavior.
  • Broad logging updates (formatting, verbosity, and max log line length).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/core/sm/launcher/tests/launcher.cpp Updates expectations for instance status notifications during UpdateInstances.
src/core/sm/launcher/launcher.hpp Refactors private launcher APIs and adds helpers for instance data/state management and update-item removal.
src/core/sm/launcher/launcher.cpp Major refactor of instance stop/start/update logic and status sending; adds instance data helpers.
src/core/sm/imagemanager/imagemanager.cpp Clarifies log messages for update-item removal paths.
src/core/iam/provisionmanager/provisionmanager.cpp Logging level/format adjustments for provisioning steps.
src/core/iam/nodemanager/nodemanager.cpp Adds logging when node info changes.
src/core/iam/certhandler/certhandler.cpp Logging level/format adjustments + log on certificate change.
src/core/common/types/unitconfig.hpp Reorders UnitConfig fields (affects aggregate init order) and updates equality implementation accordingly.
src/core/common/tools/config.hpp Increases maximum log line length.
src/core/cm/updatemanager/unitstatushandler.hpp Adds storage for “update attempt” statuses (optional + map) and new setters.
src/core/cm/updatemanager/unitstatushandler.cpp Implements update-status tracking and incorporates it into full unit status generation; expands logging.
src/core/cm/updatemanager/tests/updatemanager.cpp Updates unit-config aggregate initialization order + adds SetUpdateStatuses test.
src/core/cm/updatemanager/desiredstatushandler.cpp On update failures, records update-status into UnitStatusHandler for reporting.
src/core/cm/unitconfig/unitconfig.cpp Raises unit-config logging to info level.
src/core/cm/storagestate/tests/storagestate.cpp Updates cleanup expectations due to changed not-found handling.
src/core/cm/storagestate/storagestate.cpp Treats “stop watching non-existent state” as success; logging level adjustments.
src/core/cm/nodeinfoprovider/nodeinfoprovider.cpp Logging message/level adjustments when notifying listeners.
src/core/cm/monitoring/monitoring.cpp Adds logging when sending monitoring data.
src/core/cm/launcher/tests/launcher.cpp Logging format tweak in test output.
src/core/cm/launcher/node.cpp Adds detailed logs of stop/start instance lists sent to nodes.
src/core/cm/launcher/launcher.cpp Adds detailed logging for run requests and status updates; tweaks some log levels.
src/core/cm/imagemanager/imagemanager.cpp Adds more detailed item logging for download/install and status change events; tweaks retry log levels.
src/core/cm/alerts/alerts.cpp Adds info log with alerts batch size being sent.
Comments suppressed due to low confidence (1)

src/core/sm/launcher/launcher.cpp:399

  • UpdateInstancesImpl holds mMutex while building the statuses list and calling mSender->SendNodeInstancesStatuses(). If sending can block (I/O) or re-enter code that needs mMutex, this can stall other launcher operations. Prefer copying the needed instance statuses while holding the mutex, then releasing the mutex before calling SendNodeInstancesStatuses().
    auto sendStatus = DeferRelease(&mInstances, [this](Array<InstanceData>* instances) {
        LockGuard lock {mMutex};

        if (!mFirstStart) {
            LOG_INF() << "Send node instances statuses" << Log::Field("count", instances->Size());

            auto statuses = MakeUnique<InstanceStatusArray>(&mAllocator);

            for (const auto& instance : *instances) {
                LOG_INF() << "Node instance status" << Log::Field("instance", instance.mInfo)
                          << Log::Field("runtimeID", instance.mInfo.mRuntimeID)
                          << Log::Field("state", instance.mStatus.mState) << Log::Field(instance.mStatus.mError);

                if (auto err = statuses->EmplaceBack(instance.mStatus); !err.IsNone()) {
                    LOG_ERR() << "Failed to add instance status to list" << Log::Field("instance", instance.mInfo)
                              << Log::Field(AOS_ERROR_WRAP(err));
                }
            }

            if (auto err = mSender->SendNodeInstancesStatuses(*statuses); !err.IsNone()) {
                LOG_ERR() << "Failed to send node instances statuses" << Log::Field(err);
            }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@mykola-kobets-epam mykola-kobets-epam left a comment

Choose a reason for hiding this comment

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

Reviewed-by: Mykola Kobets <mykola_kobets@epam.com>

Copy link
Member

@mlohvynenko mlohvynenko left a comment

Choose a reason for hiding this comment

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

Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>

Copy link

@MykolaSuperman MykolaSuperman left a comment

Choose a reason for hiding this comment

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

Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>

@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 73.79310% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.24%. Comparing base (d11fc6f) to head (cc6a3ca).
⚠️ Report is 1 commits behind head on feature_unification.

Files with missing lines Patch % Lines
src/core/sm/launcher/launcher.cpp 73.04% 38 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##           feature_unification     #509      +/-   ##
=======================================================
+ Coverage                85.21%   85.24%   +0.03%     
=======================================================
  Files                      308      309       +1     
  Lines                    27430    27435       +5     
  Branches                  3704     3704              
=======================================================
+ Hits                     23374    23387      +13     
+ Misses                    4056     4048       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@al1img al1img force-pushed the integration branch 3 times, most recently from c327f4c to d81be66 Compare February 19, 2026 18:25
* make StartInstance and StopInstance add task to thread pool;
* add instance to cache in StartInstance;
* remove instance from cache in StopInstance;
* send node status based on cached instances: if instance successfully stopped,
  it is not present in the node status.

Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Kobets <mykola_kobets@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@al1img al1img merged commit 47fb596 into aosedge:feature_unification Feb 20, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants